package cn.fl.institution.controller;

import cmm.comm.facade.framework.api.ISysCdMapApiService;
import cmm.comm.facade.framework.api.ISysDictionaryApiService;
import cmm.comm.facade.framework.condition.SysCdMapDQueryCondition;
import cmm.comm.facade.framework.condition.SysStdRegionQueryCondition;
import cmm.comm.facade.framework.dto.SysCdMapDDTO;
import cmm.comm.facade.framework.dto.SysDictionaryDTO;
import cmm.comm.facade.upload.api.IUploadApiService;
import cmm.comm.facade.upload.condition.SysUlFilesRecQueryCondition;
import cmm.comm.facade.upload.dto.SysUlFilesRecDTO;
import cmm.mid.core.framework.dto.DataResultDTO;
import cmm.mid.core.framework.page.DataResultVO;
import cmm.mid.core.framework.page.KeyValueVO;
import cmm.mid.core.framework.page.ListPageVO;
import cmm.web.core.framework.controller.BaseController;
import cn.cmm.base.framework.constant.BaseConstant;
import cn.cmm.base.framework.exception.BaseException;
import cn.cmm.base.framework.logger.eum.LogExceptionEnum;
import cn.cmm.base.framework.utils.*;
import cn.cmm.cache.framework.utils.PropertiesCacheUtils;
import cn.fl.commons.result.ResponseData;
import cn.fl.customer.service.ICstBscInfoService;
import cn.fl.customer.service.ICstCorpBscInfoService;
import cn.fl.customer.service.ICstCorpTeamService;
import cn.fl.customer.service.ICstNpBscInfoService;
import cn.fl.customer.vo.CstBscInfoVO;
import cn.fl.customer.vo.CstCorpBscInfoVO;
import cn.fl.customer.vo.CstCorpTeamVO;
import cn.fl.customer.vo.CstNpBscInfoVO;
import cn.fl.enums.InsAccResEnum;
import cn.fl.framework.base.constant.WebBaseConstant;
import cn.fl.framework.base.context.CurrentThreadContext;
import cn.fl.framework.constant.DictionaryConstant;
import cn.fl.institution.api.IShnsbanksInsApiService;
import cn.fl.preloan.IProjectCstAccInfoApiService;
import cn.fl.preloan.dto.prjcstaccinfo.PrjCstAccInfoDTO;
import cn.fl.project.api.IPrjCstAccInfoApiService;
import cn.fl.project.condition.PrjBscInfoQueryCondition;
import cn.fl.project.condition.PrjCstAccInfoQueryCondition;
import cn.fl.project.constant.PrjBscInfoConstant;
import cn.fl.project.constant.PrjCstAccInfoConstant;
import cn.fl.project.constant.PrjCstBscInfoConstant;
import cn.fl.project.service.*;
import cn.fl.project.vo.PrjBscExtVO;
import cn.fl.project.vo.PrjBscInfoVO;
import cn.fl.project.vo.PrjCstAccInfoVO;
import cn.fl.system.api.ISysInsIvkValApiService;
import cn.fl.system.constant.SysInsCfgInfoConstant;
import cn.fl.system.constant.SysLogConstant;
import cn.fl.system.dto.SysInsIvkValDTO;
import cn.fl.system.service.ISysInsTabCfgService;
import cn.fl.system.service.ISysRegionService;
import cn.fl.system.service.ISysStdRegionService;
import cn.fl.system.vo.SysInsTabCfgVO;
import cn.fl.system.vo.SysRegionVO;
import cn.fl.system.vo.SysStdRegionVO;
import cn.fl.upload.constant.UploadConstant;
import cn.sqcapital.assmgt.assproject.api.IAssPrjInfoApiService;
import cn.sqcapital.assmgt.assproject.dto.AssPrjInfoDTO;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import fl.constant.facade.framework.constant.SysInsInterfaceConstant;
import fl.constant.facade.framework.constant.SystemConstant;
import fl.customer.facade.customer.condition.CstCorpTeamQueryCondition;
import fl.customer.facade.customer.constant.CustomerConstant;
import fl.inf.facade.api.ITransLogApi;
import fl.inf.facade.condition.InfTransLogQueryCondition;
import fl.inf.facade.dto.InfTransLogDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import pam.transmissionrec.facade.api.ITransLogApiService;
import pam.transmissionrec.facade.constant.InterfaceConstants;
import pam.transmissionrec.facade.dto.QueryStatusDTO;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.*;
import java.util.stream.Collectors;

/**
 * @Description: 项目资管信息配置 控制层
 */
@Controller
@RequestMapping("/project/prjBscInfoInsDistribute")
public class PrjBscInfoInsDistributeController extends BaseController {

    private static final Logger logger = LoggerFactory.getLogger(PrjBscInfoInsDistributeController.class);

    @Autowired
    private IPrjBscInfoService prjBscInfoService; // 项目基础信息表

    @Autowired
    private ISysInsTabCfgService sysInsTabCfgService; // 资管机构模块配置

    @Autowired
    private ICstBscInfoService cstBscInfoService; // 客户基础信息

    @Autowired
    private ISysInsIvkValApiService sysInsIvkValApiService; // 资管机构承接调用结果

    @Autowired
    private ICstNpBscInfoService cstNpBscInfoService; // 自然人客户基础信息表


    @Autowired
    private IPrjCstAccInfoService prjCstAccInfoService; // 项目客户信息
    @Autowired
    private IPrjBscExtService  prjBscExtService; //项目基础扩展表

    @Autowired
    private IPrjLinkManService prjLinkManService;//项目联系人信息表

    @Autowired
    private IPrjCstBscInfoService prjCstBscInfoService;//项目客户基础信息表

    /**
     * 代码映射服务
     */
    @Autowired
    private ISysCdMapApiService sysCdMapApiService;

    @Autowired
    private ITransLogApi transLogApi;
    @Autowired
    private ISysRegionService sysRegionService;

    @Autowired
    private ISysDictionaryApiService sysDictionaryApiService;

    @Autowired
    private IShnsbanksInsApiService shnsbanksInsApiService;

    /**
     * 文件上传
     */
    @Autowired
    private IUploadApiService uploadApiService;

    @Autowired
    private ITransLogApiService transLogApiService;

    @Autowired
    private ISysStdRegionService sysStdRegionService;

    @Autowired
    private ICstCorpTeamService cstCorpTeamService;

    @Autowired
    private ICstCorpBscInfoService cstCorpBscInfoService;

    @Autowired
    private IAssPrjInfoApiService assPrjInfoApiService;

    @Autowired
    private IProjectCstAccInfoApiService projectCstAccInfoApiService;


    /**
     * 转向 项目资管信息编辑页
     *
     * @param prjId 项目ID
     * @param request
     * @param response
     * @return
     */
    @RequestMapping(value = "/toPrjBscInsEditPage.do", method = { RequestMethod.GET, RequestMethod.POST })
    public Object toPrjBscInsEditPage(Long prjId, HttpServletRequest request, HttpServletResponse response) {
        ModelAndView view = new ModelAndView();
        PrjBscInfoVO prjBscInfoVO = this.prjBscInfoService.selectById(prjId);
        BaseLogUtils.info(logger, "toPrjBscInsEditPage", "prjBscInfoVO="+JSONObject.toJSONString(prjBscInfoVO));
        SysInsTabCfgVO sysInsTabCfgVO = sysInsTabCfgService.selectByInsCode(prjBscInfoVO.getInsCode());

        BaseLogUtils.info(logger, "toPrjInsCfgEditPage", "sysInsTabCfgVO="+JSONObject.toJSONString(sysInsTabCfgVO));
        if(sysInsTabCfgVO != null) {
            view.setViewName(sysInsTabCfgVO.getUrl()); // 转向资管机构的信息配置页面地址
            view.addObject("tabTitle", sysInsTabCfgVO.getTitle()); // 资管机构模块配置标题
            view.addObject("fundRasInsId", sysInsTabCfgVO.getInsId()); // 金融机构ID
            switch(prjBscInfoVO.getInsCode()) {
                case PrjBscInfoConstant.PRJ_INS_CODE_SN: // 机构苏宁
                    this.viewOfPrjBscInsEditPageForSN(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_SPD: // 机构浦发
                    this.viewOfPrjBscInsEditPageForSPD(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_ZYFL: // 浙银金租
                    this.viewOfPrjBscInsEditPageForZYFL(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_ZBBANK://机构众邦
                    this.viewOfPrjBscInfoEditPageForZB(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_PSBC://机构邮储
                    this.viewOfPrjBscInfoEditPageForYC(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_SNBANKS://苏宁银行
                    this.viewOfPrjBscInfoEditPageForSNBANKS(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_WEBANK://微众银行
                    this.viewOfPrjBscInfoEditPageForWEBANK(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_TJBANK://天津银行
                    this.viewOfPrjBscInfoEditPageForTJBANK(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_XBFL:    // 兴邦金租
                    this.viewOfPrjBscInfoEditPageForXBFL(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_JXFL: // 江西金租
                    this.viewOfPrjBscInfoEditPageForJXFL(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_XWBANK: //新网银行
                    this.viewOfPrjBscInfoEditPageForXWBANK(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_XYCBANK: //新邮储银行
                    this.viewOfPrjBscInfoEditPageForXYCBANK(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_HRBANK: //华润银行
                    this.viewOfPrjBscInfoEditPageForHRBANK(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_SXBANK: //三湘银行
                    this.viewOfPrjBscInfoEditPageForSXBANK(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_SHBANK: //上海银行股份有限公司福民支行
                    this.viewOfPrjBscInfoEditPageForSHBANK(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_ZGCBANK: //北京中关村银行股份有限公司
                    this.viewOfPrjBscInfoEditPageForZGCBANK(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_YBBANK: //宜宾银行
                    this.viewOfPrjBscInfoEditPageForYBBANK(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_SHNS: //上海农商
                    this.viewOfPrjBscInfoEditPageForSHNSBANK(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_XYFL: //兴业金租
                    this.viewOfPrjBscInfoEditPageForXYFL(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_YXFL: //越秀金租
                    this.viewOfPrjBscInfoEditPageForYXFL(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_CCBANK: //建设银行
                    this.viewOfPrjBscInfoEditPageForCCBANK(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_BHBANK: //渤海银行
                    this.viewOfPrjBscInfoEditPageForBHBANK(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_ICBCZB: //淄博工商银行
                case PrjBscInfoConstant.PRJ_INS_CODE_ICBCYT: //烟台工商银行
                    this.viewOfPrjBscInfoEditPageForICBC(request,view,prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_SMBC: //三井住友
                    this.viewOfPrjBscInfoEditPageForSMBC(request,view,prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_SYFL: //三一金融
                    this.viewOfPrjBscInfoEditPageForSYFL(request,view,prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_JXYMBANK: //江西裕民银行
                    this.viewOfPrjBscInfoEditPageForJXYMBANK(request,view,prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_TYFL: //天银租赁
                    this.viewOfPrjBscInfoEditPageForTYFL(request,view,prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_CCBANKTB: //建行（对公）
                    this.viewOfPrjBscInfoEditPageForCCBANKTB(request,view,prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_APFL: //安鹏金租
                    this.viewOfPrjBscInfoEditPageForAPFL(request,view,prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_TIANJINBANK: //天津银行 tianjinbank
                    this.viewOfPrjBscInfoEditPageForTIANJINBANK(request,view,prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_ICBCQD: //青岛工行
                    this.viewOfPrjBscInfoEditPageForICBCQD(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_YLBANK: //亿联银行
                    this.viewOfPrjBscInfoEditPageForYLBANK(request,view,prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_ZBBANKX: //众邦银行二手车
                    this.viewOfPrjBscInfoEditPageForZBBANKX(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_SSFL: //上实融资租赁有限公司
                    this.viewOfPrjBscInfoEditPageForSSFL(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_PABANK: //平安银行
                    this.viewOfPrjBscInfoEditPageForPABANK(request, view, prjBscInfoVO);
                    break;
                case PrjBscInfoConstant.PRJ_INS_CODE_SPDBANKDE:
                    this.viewOfPrjBscInfoEditPageForSPDBANKDE(request, view, prjBscInfoVO);
                    break;
                default:
                    break;
            }
        }
        // 信审初审节点flag
        view.addObject("fromCAFlag", request.getParameter("fromCAFlag"));
        // 客户经理修改flag
        view.addObject("fromCMFlag", request.getParameter("fromCMFlag"));
        view.addObject("detailFlag", request.getParameter("detailFlag"));
        view.addObject("updateFlag", request.getParameter("updateFlag"));
        BaseLogUtils.info(logger, "toPrjBscInsEditPage", "view >>>>>> "+JSONObject.toJSONString(view));
        return view;
    }

    /**
     * 转向 资方审核记录
     *
     * @param request
     * @param response
     * @return
     */
    @RequestMapping(value = "/toInsReviewTabPage.do", method = { RequestMethod.GET, RequestMethod.POST })
    public Object toInsReviewTabPage(HttpServletRequest request, HttpServletResponse response) {
        ModelAndView view = new ModelAndView("/institution/review/institutionReviewList");
        String prjId = request.getParameter("prjId");//项目ID
        view.addObject("prjId", prjId);
        BaseLogUtils.info(logger, "toInsReviewTabPage", "view >>>>>> "+JSONObject.toJSONString(view));
        return view;
    }

    /**
     * 资方审批记录列表
     *
     * @param request
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/getInsReview.do", method = { RequestMethod.GET})
    @ResponseBody
    public Object getInsReview(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        String prjId = request.getParameter("prjId");//项目ID

        DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
        ListPageVO<QueryStatusDTO> listPage = null;
        if(StringUtils.isEmpty(prjId)){
            result.setSuccess(BaseConstant.IS_YESNO_NO);
            result.setInfo("项目ID为空");
            return result;
        }
        try {
            BaseLogUtils.newWebLogger("资方审批记录-查询审批记录Start-prjId:" + prjId).info();
            List<QueryStatusDTO> queryStatusDTOS = transLogApiService.queryLoanFundStatusByPrjId(Long.valueOf(prjId));
            BaseLogUtils.newWebLogger("资方审批记录-查询审批记录End-prjId:" + prjId + ",queryStatusDTOS:" + JSON.toJSONString(queryStatusDTOS)).info();
            List queryStatusList = new ArrayList<QueryStatusDTO>();
            if (CollectionUtils.isNotEmpty(queryStatusDTOS)) {
                for (QueryStatusDTO queryStatusDTO : queryStatusDTOS) {
                    if (PrjBscInfoConstant.PRJ_INS_CODE_QDGHBANK.equals(queryStatusDTO.getFundRasInsNo()) && StringUtils.isNotBlank(queryStatusDTO.getApplyFundResult())) {
                        queryStatusDTO.setApplyLoanResult(InterfaceConstants.LoanFundStatus.loanPass.desc());
                    }
                }
                queryStatusList.addAll(queryStatusDTOS);
            }
            //查询sass资方审批记录列表 REQ-12161  资管优化 增加转我司审核节点
            BaseLogUtils.newLogger("根据项目prjId查询Sass系统资方审批记录列表Start:prjId={}",prjId).info();
            List<AssPrjInfoDTO> assPrjInfoDTOS = assPrjInfoApiService.queryLoanFundStatusByPrjId(Long.valueOf(prjId));
            BaseLogUtils.newLogger("根据项目prjId查询Sass系统资方审批记录列表End:prjId={},assPrjInfoDTOS={}",prjId,JSONObject.toJSONString(assPrjInfoDTOS)).info();
            if (CollectionUtils.isNotEmpty(assPrjInfoDTOS)) {
                QueryStatusDTO queryStatusDTO = null;
                for (AssPrjInfoDTO assPrjInfoDTO : assPrjInfoDTOS) {
                    queryStatusDTO = new QueryStatusDTO();

                    //审批结果
                    String applyLoanResult = "";
                    if("2".equals(assPrjInfoDTO.getPrjStsCd())){
                        applyLoanResult = pam.transmissionrec.facade.constant.InterfaceConstants.LoanFundStatus.loanPass.desc();
                    }else if("3".equals(assPrjInfoDTO.getPrjStsCd())){
                        applyLoanResult = pam.transmissionrec.facade.constant.InterfaceConstants.LoanFundStatus.loanReject.desc();
                    }

                    //放款结果
                    String applyFundResult = "";
                    if(("2".equals(assPrjInfoDTO.getPayStsCd())||"4".equals(assPrjInfoDTO.getPayStsCd()))){
                        applyFundResult = pam.transmissionrec.facade.constant.InterfaceConstants.LoanFundStatus.fundReject.desc();
                    }else if("3".equals(assPrjInfoDTO.getPayStsCd())){
                        applyFundResult = pam.transmissionrec.facade.constant.InterfaceConstants.LoanFundStatus.fundPass.desc();
                    }
                    queryStatusDTO.setApplyLoanResult(applyLoanResult);
                    queryStatusDTO.setApplyLoanStatus(assPrjInfoDTO.getPrjStsCd());
                    queryStatusDTO.setApplyFundResult(applyFundResult);
                    queryStatusDTO.setApplyFundStatus(assPrjInfoDTO.getPayStsCd());
                    queryStatusDTO.setFundRasInsNm(assPrjInfoDTO.getInsNm());
                    queryStatusDTO.setPrjId(assPrjInfoDTO.getPrjId());
                    queryStatusList.add(queryStatusDTO);
                }
            }
            BaseLogUtils.newLogger("所有资方审批记录列表:prjId={},queryStatusList={}",prjId,JSONObject.toJSONString(queryStatusList)).info();
            listPage = new ListPageVO<QueryStatusDTO>(queryStatusList, queryStatusList.size());
        }catch(BaseException ex) {
            result.setSuccess(BaseConstant.IS_YESNO_NO);
            result.setInfo(ex.getMessage());
            BaseLogUtils.newWebLogger("资方审批记录-查询审批记录失败-prjId:" + prjId + ",ex:" + ex.getMessage()).info();
        }catch(Exception ex) {
            result.setSuccess(BaseConstant.IS_YESNO_NO);
            result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
            BaseLogUtils.newWebLogger("资方审批记录-查询审批记录异常-prjId:" + prjId + ",ex:" + ex.getMessage()).setThrowable(ex).error(LogExceptionEnum.COMMON_CODE_0002);
        }
        return listPage;
    }

    /**
     * 发起非资管审核流程
     */
    @RequestMapping(value = "/addNonInsFlowStart.do", method = {RequestMethod.POST})
    @ResponseBody
    public Object addNonInsFlowStart(HttpServletRequest request, HttpServletResponse response) {
        Long startTm = System.currentTimeMillis();
        String prjId = request.getParameter("prjId");//项目ID
        String reason = request.getParameter("reason");//原因

        DataResultDTO result = new DataResultDTO(BaseConstant.IS_YESNO_YES, "提交评审成功!");
        BaseLogUtils.info(logger, "addNonInsFlowStart", "发起流程请求参数:"+prjId, CurrentThreadContext.getCurrentUserName());
        if (StringUtils.isEmpty(prjId)) {
            result.setSuccess(BaseConstant.IS_YESNO_NO);
            result.setInfo("项目主键为空!");
            BaseLogUtils.info(logger, "addNonInsFlowStart", "发起流程主键为空="+prjId, CurrentThreadContext.getCurrentUserName());
            return result;
        }
        if (StringUtils.isEmpty(reason)) {
            result.setSuccess(BaseConstant.IS_YESNO_NO);
            result.setInfo("发起非资管审核流程原因不能为空!");
            BaseLogUtils.info(logger, "addNonInsFlowStart", "发起流程主键为空="+reason, CurrentThreadContext.getCurrentUserName());
            return result;
        }
        try {
            result = this.prjBscInfoService.addNonInsFlowStart(Long.valueOf(prjId), reason, CurrentThreadContext.getCurrentUserId(), CurrentThreadContext.getCurrentUserName());
        } catch (BaseException e) {
            result.setSuccess(BaseConstant.IS_YESNO_NO);
            result.setInfo(e.getMessage());
            BaseLogUtils.info(logger,"addNonInsFlowStart","发起流程失败."+prjId,CurrentThreadContext.getCurrentUserName(),e);
        } catch (Exception e) {
            result.setSuccess(BaseConstant.IS_YESNO_NO);
            result.setInfo("提交评审系统错误,请联系管理员！");
            BaseLogUtils.info(logger,"addNonInsFlowStart","发起流程系统异常."+prjId,CurrentThreadContext.getCurrentUserName(),e);
        }
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "addNonInsFlowStart", "发起流程请求耗时:"+(endTm-startTm), CurrentThreadContext.getCurrentUserName());
        return result;
    }

    /**
     * 转向填写资管资料页面 新网银行
     * @param request
     * @param view   viewOfPrjBscInfoEditPageForXWBANK
     * @param prjBscInfoVO
     */
    private DataResultVO viewOfPrjBscInfoEditPageForXWBANK(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");
        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForXWBANK", "根据prjId获取账户信息："+prjBscInfoVO.getId());
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForXWBANK", "根据prjId获取账户信息" + JSON.toJSONString(prjCstAccInfoVOS));
        PrjCstAccInfoVO vo = new PrjCstAccInfoVO();
        if(CollectionUtils.isNotEmpty(prjCstAccInfoVOS)){
            vo = prjCstAccInfoVOS.get(0);
        }
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForXWBANK", "根据ID查询自然人客户基本信息返回==cstNpBscInfoDTO" + JSON.toJSONString(cstNpBscInfoVO));
        String monthInc = "";
        if (null != cstNpBscInfoVO) {
            Long yrInc = cstNpBscInfoVO.getYrInc();
            if (null != yrInc) {
                //年收入 / 12 / 100 转元 得到 月收入（元）
                monthInc = String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(yrInc), 12D));
            }
        }
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("certNo", prjBscInfoVO.getCertNo());//身份证号
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        view.addObject("rgnPrCd", prjBscInfoVO.getRgnPrCd());//区域省
        view.addObject("rgnCyCd", prjBscInfoVO.getRgnCyCd());//区域市
        view.addObject("cstAccInfoId", vo.getId()); // 项目客户账号信息主键
        view.addObject("bkNm", vo.getBkNm()); // 银行名称
        view.addObject("bkCd", vo.getBkCd()); // 银行代码
        view.addObject("accNo", vo.getAccNo()); // 银行账号
        view.addObject("mp", vo.getMp()); // 银行卡绑定手机号
        view.addObject("monthInc", monthInc);//月收入
        view.addObject("rgnPrCd2", cstNpBscInfoVO.getDomicileProvince());//居住地省(取户籍所在地)
        view.addObject("rgnCyCd2", cstNpBscInfoVO.getDomicleCity());//居住地市(取户籍所在地)

        List<KeyValueVO> bankList = getBankList(PrjBscInfoConstant.PRJ_INS_CODE_XWBANK);
        view.addObject("bankList",bankList);
        resultVO.setData(view);
        return resultVO;
    }

    /**
     * 转向填写资管资料页面 新邮储银行
     * @param request
     * @param view   viewOfPrjBscInfoEditPageForXYCBANK
     * @param prjBscInfoVO
     */
    private DataResultVO viewOfPrjBscInfoEditPageForXYCBANK(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForXYCBANK", "根据ID查询自然人客户基本信息返回==cstNpBscInfoDTO" + JSON.toJSONString(cstNpBscInfoVO));
        String monthInc = "";
        if (null != cstNpBscInfoVO && null != cstNpBscInfoVO.getYrInc()) {
            Long yrInc = cstNpBscInfoVO.getYrInc();
            monthInc = String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(yrInc), 12D));
        }
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        view.addObject("monthInc", monthInc);//月收入
        resultVO.setData(view);
        return resultVO;
    }

    /**
     * 转向填写资管资料页面 华润银行
     * @param request
     * @param view   viewOfPrjBscInfoEditPageForHRBANK
     * @param prjBscInfoVO
     */
    private DataResultVO viewOfPrjBscInfoEditPageForHRBANK(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");
        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForHRBANK", "根据prjId获取账户信息：" + prjBscInfoVO.getId());
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForHRBANK", "根据prjId获取账户信息" + JSON.toJSONString(prjCstAccInfoVOS));
        PrjCstAccInfoVO vo = new PrjCstAccInfoVO();
        if(CollectionUtils.isNotEmpty(prjCstAccInfoVOS)){
            vo = prjCstAccInfoVOS.get(0);
        }
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("certNo", prjBscInfoVO.getCertNo());//身份证号
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        view.addObject("cstAccInfoId", vo.getId()); // 项目客户账号信息主键
        view.addObject("bkNm", vo.getBkNm()); // 银行名称
        view.addObject("bkCd", vo.getBkCd()); // 银行代码
        view.addObject("accNo", vo.getAccNo()); // 银行账号
        view.addObject("mp", vo.getMp()); // 银行卡绑定手机号

        List<KeyValueVO> list = getBankList(PrjBscInfoConstant.PRJ_INS_CODE_HRBANK);
        view.addObject("bankList",list);
        resultVO.setData(view);
        return resultVO;
    }

    /**
     * 转向填写资管资料页面 三湘银行
     * @param request
     * @param view   viewOfPrjBscInfoEditPageForSXBANK
     * @param prjBscInfoVO
     */
    private DataResultVO viewOfPrjBscInfoEditPageForSXBANK(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");
        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForSXBANK", "根据prjId获取账户信息：" + prjBscInfoVO.getId());
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForSXBANK", "根据prjId获取账户信息" + JSON.toJSONString(prjCstAccInfoVOS));
        PrjCstAccInfoVO vo = new PrjCstAccInfoVO();
        if(CollectionUtils.isNotEmpty(prjCstAccInfoVOS)){
            vo = prjCstAccInfoVOS.get(0);
        }
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForSXBANK", "根据ID查询自然人客户基本信息返回==cstNpBscInfoDTO" + JSON.toJSONString(cstNpBscInfoVO));
        String monthInc = "";
        if (null != cstNpBscInfoVO && null != cstNpBscInfoVO.getYrInc()) {
            Long yrInc = cstNpBscInfoVO.getYrInc();
            monthInc = String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(yrInc), 12D));
        }
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("certNo", prjBscInfoVO.getCertNo());//身份证号
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        view.addObject("cstAccInfoId", vo.getId()); // 项目客户账号信息主键
        view.addObject("bkNm", vo.getBkNm()); // 银行名称
        view.addObject("bkCd", vo.getBkCd()); // 银行代码
        view.addObject("accNo", vo.getAccNo()); // 银行账号
        view.addObject("mp", vo.getMp()); // 银行卡绑定手机号
        view.addObject("monthInc", monthInc);//月收入

        if(null != prjBscInfoVO.getCstId()) {
            if(null != cstNpBscInfoVO) {
                String certValidSDt = cstNpBscInfoVO.getCertValidSDt(); // 证件有效起始日期
                String certValidEDt = cstNpBscInfoVO.getCertValidEDt(); // 证件有效终止日期
                view.addObject("certValidSDt", certValidSDt == null ? "" : certValidSDt);
                view.addObject("certValidEDt", certValidEDt == null ? "" : certValidEDt);
            }
        }

        List<KeyValueVO> list = getBankList(PrjBscInfoConstant.PRJ_INS_CODE_SXBANK);
        view.addObject("bankList",list);
        resultVO.setData(view);
        return resultVO;
    }

    private void viewOfPrjBscInfoEditPageForXBFL (HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");

        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
        BaseLogUtils.newLogger("兴邦金租银行信息采集Start,prjId:{}", prjBscInfoVO.getId()).info();
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        BaseLogUtils.newLogger("兴邦金租银行信息采集End,prjId:{},result:{}", prjBscInfoVO.getId(), JSONObject.toJSONString(prjCstAccInfoVOS)).info();
        PrjCstAccInfoVO vo = new PrjCstAccInfoVO();
        if(CollectionUtils.isNotEmpty(prjCstAccInfoVOS)){
            vo = prjCstAccInfoVOS.get(0);
        }

        BaseLogUtils.newLogger("兴邦金租获取自然人信息Start,cstId:{}", prjBscInfoVO.getCstId()).info();
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        BaseLogUtils.newLogger("兴邦金租获取自然人信息End,cstId:{},result:{}", prjBscInfoVO.getCstId(), JSON.toJSONString(cstNpBscInfoVO)).info();

        if(null != cstNpBscInfoVO){
            //民族
            view.addObject("nation", cstNpBscInfoVO.getNation());
            //年收入
            Long yrInc = cstNpBscInfoVO.getYrInc();
            if (null != yrInc) {
                //年收入 / 12 / 100 转元 得到 月收入（元）
                String monthInc = String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(yrInc), 12D));
                BigDecimal decimal = new BigDecimal(monthInc);
                monthInc = decimal.toPlainString();
                view.addObject("monthInc",monthInc);
            }
            //身份证件有效截止日期
            view.addObject("certValidEDt", cstNpBscInfoVO.getCertValidEDt());
            //REQ-13119 资管优化V1.10.7兴邦信息采集 增加居住地址及户籍地址信息
            // 居住省-编码
            String postProvince = cstNpBscInfoVO.getPostProvince();
            view.addObject("postProvince", postProvince);
            if (StringUtils.isNotBlank(postProvince)) {
                // 居住省-名称
                view.addObject("postProvinceNm", this.getCommonRegionDictNm(postProvince));
            }
            // 居住市-编码
            String postCity = cstNpBscInfoVO.getPostCity();
            view.addObject("postCity", postCity);
            if (StringUtils.isNotBlank(postCity)) {
                // 居住市-名称
                view.addObject("postCityNm", this.getCommonRegionDictNm(postCity));
            }
            //居住地址
            view.addObject("postAddr", cstNpBscInfoVO.getPostAddr());
            // 户籍所在地省-编码
            String domicileProvince = cstNpBscInfoVO.getDomicileProvince();
            view.addObject("domicileProvince", domicileProvince);
            if (StringUtils.isNotBlank(domicileProvince)) {
                // 户籍所在地区县-名称
                view.addObject("domicileProvinceNm", this.getCommonRegionDictNm(domicileProvince));
            }
            // 户籍所在地市-编码
            String domicileCity = cstNpBscInfoVO.getDomicleCity();
            view.addObject("domicileCity", domicileCity);
            if (StringUtils.isNotBlank(domicileCity)) {
                // 户籍所在地市-名称
                view.addObject("domicileCityNm", this.getCommonRegionDictNm(domicileCity));
            }
        }

        view.addObject("cstAccInfoId", vo.getId()); // 项目客户账号信息主键
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("bkNm", vo.getBkNm()); // 银行名称
        view.addObject("bkNo", vo.getBkNo()); // 开户行号
        view.addObject("bkCd", vo.getBkCd()); // 银行代码
        view.addObject("accNo", vo.getAccNo()); // 银行账号
        view.addObject("mp", vo.getMp()); // 银行卡绑定手机号
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code
        view.addObject("certNo", prjBscInfoVO.getCertNo());//身份证号

        //民族列表
        List<KeyValueVO> nationList = sysDictionaryApiService.getKvList("CST0060", "30000", "0000");
        for (KeyValueVO keyValueVO:nationList){
            keyValueVO.setValue(keyValueVO.getValue().trim());
        }
        view.addObject("nationList",nationList);
        //查询开户行列表 并将各开户行限额存入map集合中
        JSONObject singleQuotaMap = new JSONObject();
        List<KeyValueVO> list = getBankList(PrjBscInfoConstant.PRJ_INS_CODE_XBFL,singleQuotaMap);
        view.addObject("bankList",list);
        view.addObject("singleQuotaMap",singleQuotaMap);
        String singleQuota = "";
        if(StringUtils.isNotBlank(vo.getBkCd())){
            singleQuota = singleQuotaMap.getString(vo.getBkCd());
        }
        view.addObject("singleQuota", singleQuota);

        resultVO.setData(view);
    }

	/**
	 * 转向填写资管资料页面 机构浦发
	 * @param request
	 * @param view
	 * @param prjBscInfoVO
	 */
	private void viewOfPrjBscInsEditPageForSPD(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
		view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
		view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 金融机构名称
		view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
		view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户姓名
		view.addObject("insCode", StringUtils.isNotEmpty(prjBscInfoVO.getInsCode()) ? prjBscInfoVO.getInsCode() : ""); // 机构编码
		view.addObject("thdaccsts", "未开户");//浦发开户状态

        PrjCstAccInfoQueryCondition cstAccInfoQueryCondition = new PrjCstAccInfoQueryCondition();
        cstAccInfoQueryCondition.setCstId(prjBscInfoVO.getCstId());
        cstAccInfoQueryCondition.setInsCode(prjBscInfoVO.getInsCode());
        BaseLogUtils.info(logger,"viewOfPrjBscInsEditPageForSPD","查询浦发项目客户账户信息开始=="+cstAccInfoQueryCondition);
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(cstAccInfoQueryCondition);
        BaseLogUtils.info(logger,"viewOfPrjBscInsEditPageForSPD","查询浦发项目客户账户信息结束=="+JSON.toJSONString(prjCstAccInfoVOS));
        PrjCstAccInfoVO prjCstAccInfoVO = null;
        for (PrjCstAccInfoVO prjCstAccInfo : prjCstAccInfoVOS) {
            //获取当前项目关联未删除的信息
            if (Objects.equals(prjBscInfoVO.getId(), prjCstAccInfo.getPrjId())) {
                //该项目已存在客户信息 返回前台
                prjCstAccInfoVO = prjCstAccInfo;
                break;
            }
        }
        if(null == prjCstAccInfoVO){
            if (CollectionUtils.isNotEmpty(prjCstAccInfoVOS)) {
                for (PrjCstAccInfoVO prjCstAccInfo : prjCstAccInfoVOS) {
                    //查询客户账户信息获取该客户历史开户成功的信息
                    if (Objects.equals(InsAccResEnum.SUCCESS.code, prjCstAccInfo.getAccResCd()) && null != prjCstAccInfo.getBkCd()) {
                        prjCstAccInfoVO = prjCstAccInfo;
                        break;
                    }
                }
                if(null == prjCstAccInfoVO){
                    //查询日志记录获取该客户历史开户成功的信息
                    InfTransLogQueryCondition infTransLogQueryCondition = new InfTransLogQueryCondition();
                    infTransLogQueryCondition.setCstId(prjBscInfoVO.getCstId());
                    infTransLogQueryCondition.setFundRasInsId(prjBscInfoVO.getFundRasInsId());
                    infTransLogQueryCondition.setAction(SysInsInterfaceConstant.InsTypeIntfConstant.SPDBANK_TYPE_QUERY_ACCOUNT);
                    BaseLogUtils.info(logger,"viewOfPrjBscInsEditPageForSPD","账户开户接口开始=="+JSON.toJSONString(infTransLogQueryCondition));
                    List<InfTransLogDTO> infTransLogDTOList = transLogApi.findTransLogs(infTransLogQueryCondition);
                    BaseLogUtils.info(logger,"viewOfPrjBscInsEditPageForSPD","账户开户接口结果=="+JSON.toJSONString(infTransLogDTOList));
                    if (CollectionUtils.isNotEmpty(infTransLogDTOList)) {
                        for (InfTransLogDTO infTransLogDTO : infTransLogDTOList) {
                            for (PrjCstAccInfoVO prjCstAccInfo : prjCstAccInfoVOS) {
                                if (Objects.equals(infTransLogDTO.getPrjId(), prjCstAccInfo.getPrjId())  && null != prjCstAccInfo.getBkCd() && InsAccResEnum.SUCCESS.code.equals(infTransLogDTO.getRespCode())) {
                                    prjCstAccInfoVO = prjCstAccInfo;
                                    prjCstAccInfoVO.setAccResCd(infTransLogDTO.getRespCode());
                                    prjCstAccInfoVO.setAccResMsg(infTransLogDTO.getRespDesc());
                                    break;
                                }
                            }
                            if (null != prjCstAccInfoVO) {
                                break;
                            }
                        }
                    }
                }
            }
            if(null != prjCstAccInfoVO){
                prjCstAccInfoVO.setId(null);
                prjCstAccInfoVO.setPrjId(Long.valueOf(prjBscInfoVO.getId()));
                prjCstAccInfoVO.setCrtTm(new Date());
                prjCstAccInfoVO.setMdfTm(new Date());
                prjCstAccInfoVO.setIsDel(BaseConstant.IS_YESNO_NO);
                prjCstAccInfoVO.setInsCode(prjBscInfoVO.getInsCode());
                BaseLogUtils.info(logger,"viewOfPrjBscInsEditPageForSPD","新增浦发项目复制客户账户开始=="+JSON.toJSONString(prjCstAccInfoVO));
                Long add = this.prjCstAccInfoService.add(prjCstAccInfoVO);
                BaseLogUtils.info(logger,"viewOfPrjBscInsEditPageForSPD","新增浦发项目复制客户账户完成=="+prjBscInfoVO.getId()+"，add="+add);
                prjCstAccInfoVO.setId(add);
            }
        }
		if (null != prjCstAccInfoVO) {
			BaseLogUtils.info(logger, "viewOfPrjBscInsEditPageForSPD", "prjCstAccInfoVO >>>>>> "+JSONObject.toJSONString(prjCstAccInfoVO));
			view.addObject("cstAccInfoId", prjCstAccInfoVO.getId()); // 项目客户账号信息主键
			view.addObject("certNo", prjCstAccInfoVO.getCertNo()); // 证件号码
			view.addObject("certTypCd", prjCstAccInfoVO.getCertTypCd()); // 证件类型
			view.addObject("bkNm", prjCstAccInfoVO.getBkNm()); // 银行名称
			view.addObject("bkNo", prjCstAccInfoVO.getBkNo()); // 银行代码
			view.addObject("accNo", prjCstAccInfoVO.getAccNo()); // 银行账号
			view.addObject("mp", prjCstAccInfoVO.getMp()); // 银行卡绑定手机号

			boolean createAccountSucc = false;
			if(StringUtils.isNotBlank(prjCstAccInfoVO.getAccResCd())){
				if("0000".equals(prjCstAccInfoVO.getAccResCd())){
					view.addObject("thdaccsts", "成功");
				}else if("1000".equals(prjCstAccInfoVO.getAccResCd()) || "0001".equals(prjCstAccInfoVO.getAccResCd())){
					view.addObject("thdaccsts", "处理中");
				}else{
					view.addObject("thdaccsts", "失败");
					view.addObject("thdaccrem","以下失败信息为浦发提供，如无法定位原因可与运维联系;\n"+prjCstAccInfoVO.getAccResMsg());//浦发开户失败原因
				}
				createAccountSucc = ("0000".equals(prjCstAccInfoVO.getAccResCd()) || "1000".equals(prjCstAccInfoVO.getAccResCd()) || "0001".equals(prjCstAccInfoVO.getAccResCd()));
			}else{
				InfTransLogQueryCondition infTransLogQueryCondition = new InfTransLogQueryCondition();
				infTransLogQueryCondition.setPrjId(prjCstAccInfoVO.getPrjId());
				infTransLogQueryCondition.setCstId(prjCstAccInfoVO.getCstId());
				infTransLogQueryCondition.setFundRasInsId(prjBscInfoVO.getFundRasInsId());
				infTransLogQueryCondition.setAction(SysInsInterfaceConstant.InsTypeIntfConstant.SPDBANK_TYPE_QUERY_ACCOUNT);
				List<InfTransLogDTO> infTransLogDTOList = transLogApi.findTransLogs(infTransLogQueryCondition);
				InfTransLogDTO infTransLogDTO = null;
				if(CollectionUtils.isNotEmpty(infTransLogDTOList)) {
					infTransLogDTO = infTransLogDTOList.get(0);
					BaseLogUtils.info(logger, "getPrjAccInfo", "账户开户接口结果"+JSONObject.toJSONString(infTransLogDTO));
					if("0000".equals(infTransLogDTO.getRespCode())){
						view.addObject("thdaccsts", "成功");
					}else if("1000".equals(infTransLogDTO.getRespCode()) || "0001".equals(prjCstAccInfoVO.getAccResCd())){
						view.addObject("thdaccsts", "处理中");
					}else{
						view.addObject("thdaccsts", "失败");
						view.addObject("thdaccrem","以下失败信息为浦发提供，如无法定位原因可与运维联系;\n"+infTransLogDTO.getRespDesc());//浦发开户失败原因
					}
				}else{
					view.addObject("thdaccsts", "未开户");//浦发开户状态
				}
				createAccountSucc = infTransLogDTO != null
						&& ("0000".equals(infTransLogDTO.getRespCode()) || "1000".equals(infTransLogDTO.getRespCode()) || "0001".equals(prjCstAccInfoVO.getAccResCd()));
			}
			view.addObject("createAccountSucc", String.valueOf(createAccountSucc));

		} else {
			CstBscInfoVO cstBscInfoVO = this.cstBscInfoService.selectDetailById(prjBscInfoVO.getCstId());
			if (DictionaryConstant.CODE_CERT_TYP_CD_0.equals(cstBscInfoVO.getCertTypCd())) {
				view.addObject("certNo", cstBscInfoVO.getCertNo()); // 证件号码
			}
		}

        // 月收入
        view.addObject("monIncmYuan", 0); // 月收入
        if(null != prjBscInfoVO.getCstId()) {
            CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
            if(null != cstNpBscInfoVO ) {
                Long yrInc = cstNpBscInfoVO.getYrInc() ;
                if(null != yrInc){
                    String monIncmYuan = String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(yrInc), 12, 0));
                    view.addObject("monIncmYuan", monIncmYuan); // 月收入
                }
                view.addObject("highDgCd", cstNpBscInfoVO.getHighDgCd());
            }
            List<KeyValueVO> highDgCdList = this.sysDictionaryApiService.getKvList(DictionaryConstant.CODE_GRP_CST_HIGH_DG_CD, CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd());
            view.addObject("highDgCdList", highDgCdList);
        }

        // 浦发支持的银行列表
        List<KeyValueVO> bankList = getBankList(PrjBscInfoConstant.PRJ_INS_CODE_SPD);
        view.addObject("bankList",bankList);

    }

    /**
     * 转向填写资管资料页面 机构苏宁
     * @param request
     * @param view
     * @param prjBscInfoVO
     */
    private void viewOfPrjBscInsEditPageForSN(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 金融机构名称
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户姓名
        view.addObject("insCode", StringUtils.isNotEmpty(prjBscInfoVO.getInsCode()) ? prjBscInfoVO.getInsCode() : ""); // 机构编码

        PrjCstAccInfoVO prjCstAccInfoVO = prjBscInfoVO.getPrjCstAccInfoVO();
        if (null != prjCstAccInfoVO) {
            BaseLogUtils.info(logger, "viewOfPrjBscInsEditPageForSN", "prjCstAccInfoVO >>>>>> "+JSONObject.toJSONString(prjCstAccInfoVO));
            view.addObject("cstAccInfoId", prjCstAccInfoVO.getId()); // 项目客户账号信息主键
            view.addObject("bkNm", prjCstAccInfoVO.getBkNm()); // 银行名称
            view.addObject("bkNo", prjCstAccInfoVO.getBkNo()); // 银行代码
            view.addObject("accNo", prjCstAccInfoVO.getAccNo()); // 银行账号
            view.addObject("mp", prjCstAccInfoVO.getMp()); // 银行卡绑定手机号
            view .addObject("insAccNo", prjCstAccInfoVO.getInsAccNo()); // 机构户头号

            // 查找开户接口的调用结果
            SysInsIvkValDTO sysInsIvkValDTO = sysInsIvkValApiService.getSysInsIvkValDTO(prjBscInfoVO.getId(), prjBscInfoVO.getFundRasInsId(),
                    SysInsInterfaceConstant.InsTypeIntfConstant.SNBANK_TYPE_SIGN_ACCOUNT);
            view.addObject("createAccountSucc", null != sysInsIvkValDTO && sysInsIvkValDTO.isSuccess());

        } else {
            CstBscInfoVO cstBscInfoVO = this.cstBscInfoService.selectDetailById(prjBscInfoVO.getCstId());
            if (DictionaryConstant.CODE_CERT_TYP_CD_0.equals(cstBscInfoVO.getCertTypCd())) {
                view.addObject("certNo", cstBscInfoVO.getCertNo()); // 证件号码
            }
        }

        // 苏宁支持的银行列表
        List<KeyValueVO> bankList = getBankList(PrjBscInfoConstant.PRJ_INS_CODE_SN);
        view.addObject("bankList",bankList);
    }

    /**
     * 转向填写资管资料页面 浙银金租
     * @param request
     * @param view
     * @param prjBscInfoVO
     */
    private void viewOfPrjBscInsEditPageForZYFL(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 金融机构名称
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户姓名
        view.addObject("insCode", StringUtils.isNotEmpty(prjBscInfoVO.getInsCode())
                && !PrjBscInfoConstant.PRJ_INS_CODE_ZYFL.equals(prjBscInfoVO.getInsCode()) ? prjBscInfoVO.getInsCode() : ""); // 机构编码

        // 项目客户账号信息（保存之后才有）
        PrjCstAccInfoVO prjCstAccInfoVO = prjBscInfoVO.getPrjCstAccInfoVO();
        if (null != prjCstAccInfoVO) {
            BaseLogUtils.info(logger, "viewOfPrjBscInsEditPageForZYFL", "prjCstAccInfoVO >>>>>> "+JSONObject.toJSONString(prjCstAccInfoVO));
            view.addObject("cstAccInfoId", prjCstAccInfoVO.getId()); // 项目客户账号信息主键
            view.addObject("bkNm", prjCstAccInfoVO.getBkNm()); // 银行名称
            view.addObject("bkCd", prjCstAccInfoVO.getBkCd()); // 银行代码
            view.addObject("bkNo", prjCstAccInfoVO.getBkNo()); // 开户行号
            view.addObject("accNo", prjCstAccInfoVO.getAccNo()); // 银行账号
            view.addObject("mp", prjCstAccInfoVO.getMp()); // 银行卡绑定手机号
        }

        // 客户基本信息和自然人信息
        CstBscInfoVO cstBscInfoVO = this.cstBscInfoService.selectDetailById(prjBscInfoVO.getCstId());
        if (null != cstBscInfoVO && DictionaryConstant.CODE_CERT_TYP_CD_0.equals(cstBscInfoVO.getCertTypCd())) { // 如果证件类型是身份证
            view.addObject("certNo", cstBscInfoVO.getCertNo()); // 证件号码

            // 自然人信息
            view.addObject("monIncmYuan", 0);
            CstNpBscInfoVO cstNpBscInfoVO = cstBscInfoVO.getCstNpBscInfoVO();
            if(null != cstNpBscInfoVO) {
                String certValidSDt = cstNpBscInfoVO.getCertValidSDt(); // 证件有效起始日期
                String certValidEDt = cstNpBscInfoVO.getCertValidEDt(); // 证件有效终止日期
                view.addObject("certValidSDt", certValidSDt == null ? "" : certValidSDt);
                view.addObject("certValidEDt", certValidEDt == null ? "" : certValidEDt);
                if(StringUtils.isNotEmpty(cstNpBscInfoVO.getYrInc())){
                    Long yrInc = cstNpBscInfoVO.getYrInc() ;
                    String monIncmYuan = String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(yrInc), 12, 0));
                    view.addObject("monIncmYuan", monIncmYuan); // 月收入
                }
            }
        }

        // 查询支持的银行列表
        List<KeyValueVO> bankList = this.prjCstAccInfoService.searchCdList(PrjCstAccInfoConstant.CODE_SQ_SUPPORT_BANK_CD);
        view.addObject("bankList",bankList);
    }
    /**
     * 转向填写资管资料页面 众邦银行
     * @param request
     * @param view   viewOfPrjBscInfoEditPageForZB
     * @param prjBscInfoVO
     */
    /**
     * SysStdRegion 服务层BEAN
     */
    private DataResultVO viewOfPrjBscInfoEditPageForZB(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");
        String rgnPrCdNm = ""; // 省名称
        String rgnCyCdNm = ""; // 市名称
        String rgnCountyNm ="";//县名称
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 金融机构名称
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 账户名称
        view.addObject("insCode", StringUtils.isNotEmpty(prjBscInfoVO.getInsCode())
                && !PrjBscInfoConstant.PRJ_INS_CODE_ZBBANK.equals(prjBscInfoVO.getInsCode()) ? prjBscInfoVO.getInsCode() : ""); // 机构编码

        //区域
        PrjBscExtVO prjBscExt = this.prjBscInfoService.selectByPrjBscExtId(prjBscInfoVO.getId());
        if(null != prjBscExt){
            if(StringUtils.isNotEmpty(prjBscExt.getRgnProCd())){
                String rgnProCd = prjBscExt.getRgnProCd(); //省
                SysStdRegionQueryCondition condition = new SysStdRegionQueryCondition();
                condition.setSysCd(CurrentThreadContext.getCurrentSysCd());
                condition.setRgnCd(rgnProCd);
                List<SysStdRegionVO> stdRegionListVO = this.sysStdRegionService.searchStdRegionList(condition);
                if(null != stdRegionListVO ){
                    SysStdRegionVO sysStdRegionVO = stdRegionListVO.get(0);
                    rgnPrCdNm = sysStdRegionVO.getRgnNm();

                }
                view.addObject("rgnProCd", rgnProCd);
            }
            if(StringUtils.isNotEmpty(prjBscExt.getRgnCtCd())){//市
                String rgnCtCd = prjBscExt.getRgnCtCd();
                // String rgnPid = prjBscExt.getRgnProCd();//上级省
                SysStdRegionQueryCondition condition = new SysStdRegionQueryCondition();
                condition.setSysCd(CurrentThreadContext.getCurrentSysCd());
                condition.setRgnCd(rgnCtCd);
                List<SysStdRegionVO> stdRegionListVO = this.sysStdRegionService.searchStdRegionList(condition);
                if(null != stdRegionListVO ){
                    SysStdRegionVO sysStdRegionVO = stdRegionListVO.get(0);
                    rgnCyCdNm = sysStdRegionVO.getRgnNm();

                }
                view.addObject("rgnCtCd", rgnCtCd);
            }
            if(StringUtils.isNotBlank(prjBscExt.getRgnTwCd())){//县
                String rgnTwCd = prjBscExt.getRgnTwCd();
                SysStdRegionQueryCondition condition = new SysStdRegionQueryCondition();
                condition.setSysCd(CurrentThreadContext.getCurrentSysCd());
                condition.setRgnCd(rgnTwCd);
                List<SysStdRegionVO> stdRegionListVO = this.sysStdRegionService.searchStdRegionList(condition);
                if(null != stdRegionListVO ){
                    SysStdRegionVO sysStdRegionVO = stdRegionListVO.get(0);
                    rgnCountyNm = sysStdRegionVO.getRgnNm();

                }
                view.addObject("rgnTwCd", rgnTwCd);
            }
            view.addObject("rgnPrCdNm",rgnPrCdNm); //省
            view.addObject("rgnCyCdNm", rgnCyCdNm ); //市
            view.addObject("rgnCountyNm", rgnCountyNm); //县
        }
        // 项目客户账号信息（保存之后才有）
//		PrjCstAccInfoVO prjCstAccInfoVO = this.prjCstAccInfoService.selectByPrjId(prjBscInfoVO.getId());
        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        BaseLogUtils.info(logger, "viewOfPrjBscInsEditPageForZB", "根据cstID和insCode获取账户信息prjCstAccInfoQC==："+JSON.toJSONString(prjCstAccInfoQC));
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        BaseLogUtils.info(logger, "viewOfPrjBscInsEditPageForZB", "根据cstID和insCode获取账户信息" + JSON.toJSONString(prjCstAccInfoVOS));
        if (CollectionUtils.isNotEmpty(prjCstAccInfoVOS)) {
            PrjCstAccInfoVO prjCstAccInfoVO = prjCstAccInfoVOS.get(0);
            BaseLogUtils.info(logger, "viewOfPrjBscInsEditPageForZB", "prjCstAccInfoVO >>>>>> "+JSONObject.toJSONString(prjCstAccInfoVO));
            view.addObject("cstAccInfoId", prjCstAccInfoVO.getId()); // 项目客户账号信息主键
            view.addObject("bkNm", prjCstAccInfoVO.getBkNm()); // 银行名称
            view.addObject("bkCd", prjCstAccInfoVO.getBkCd()); // 银行代码
            view.addObject("bkNo", prjCstAccInfoVO.getBkNo()); // 开户行号
            view.addObject("accNo", prjCstAccInfoVO.getAccNo()); // 银行账号
            view.addObject("mp", prjCstAccInfoVO.getMp()); // 银行卡绑定手机号
        }
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        // 月收入
        view.addObject("monIncmYuan", 0); // 月收入
        if(null != prjBscInfoVO.getCstId()) {
            if(null != cstNpBscInfoVO && null != cstNpBscInfoVO.getYrInc()) {
                Long yrInc = cstNpBscInfoVO.getYrInc() ;
                String monIncmYuan = String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(yrInc), 12, 0));
                view.addObject("monIncmYuan", monIncmYuan); // 月收入
            }
        }
        if(null != cstNpBscInfoVO && null != cstNpBscInfoVO.getCertValidSDt() && null != cstNpBscInfoVO.getCertValidEDt()){
            // 客户基本信息和自然人信息
            String certValidSDt = cstNpBscInfoVO.getCertValidSDt(); // 证件有效起始日期
            String certValidEDt = cstNpBscInfoVO.getCertValidEDt(); // 证件有效终止日期
            view.addObject("certValidSDt", certValidSDt == null ? "" : certValidSDt);
            view.addObject("certValidEDt", certValidEDt == null ? "" : certValidEDt);
        }
        // 查询支持的银行列表
        List<KeyValueVO> bankList = this.prjCstAccInfoService.searchCdList(PrjCstAccInfoConstant.CODE_ZB_SUPPORT_BANK_CD);
        view.addObject("bankList",bankList);
        return resultVO;
    }
    /**
     * 转向填写资管资料页面 邮储银行
     * @param request
     * @param view   viewOfPrjBscInfoEditPageForZB
     * @param prjBscInfoVO
     */
    private DataResultVO viewOfPrjBscInfoEditPageForYC(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 金融机构名称
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("insCode", StringUtils.isNotEmpty(prjBscInfoVO.getInsCode())
                && !PrjBscInfoConstant.PRJ_INS_CODE_ZBBANK.equals(prjBscInfoVO.getInsCode()) ? prjBscInfoVO.getInsCode() : ""); // 机构编码
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");
        // 项目客户账号信息（保存之后才有）
//		PrjCstAccInfoVO prjCstAccInfoVO = this.prjCstAccInfoService.selectByPrjId(prjBscInfoVO.getId());
        PrjCstAccInfoQueryCondition cstAccInfoQueryCondition = new PrjCstAccInfoQueryCondition();
        cstAccInfoQueryCondition.setPrjId(prjBscInfoVO.getId());
        cstAccInfoQueryCondition.setInsCode(prjBscInfoVO.getInsCode());
        cstAccInfoQueryCondition.setIsDel(BaseConstant.IS_YESNO_NO);
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(cstAccInfoQueryCondition);
        if (CollectionUtils.isNotEmpty(prjCstAccInfoVOS)) {
            PrjCstAccInfoVO prjCstAccInfoVO = prjCstAccInfoVOS.get(0);
            BaseLogUtils.info(logger, "viewOfPrjBscInsEditPageForZB", "prjCstAccInfoVO >>>>>> "+JSONObject.toJSONString(prjCstAccInfoVO));
            view.addObject("cstAccInfoId", prjCstAccInfoVO.getId()); // 项目客户账号信息主键
            //view.addObject("bkNm", prjCstAccInfoVO.getBkNm()); // 银行名称
            //view.addObject("bkCd", prjCstAccInfoVO.getBkCd()); // 银行代码
            view.addObject("accNo", prjCstAccInfoVO.getAccNo()); // 银行账号
            view.addObject("mp", prjCstAccInfoVO.getMp()); // 银行卡绑定手机号
            view.addObject("certNo", prjCstAccInfoVO.getCertNo()); // 证件号码
            view.addObject("certTypCd", prjCstAccInfoVO.getCertTypCd()); // 证件类型
        }
        CstBscInfoVO cstBscInfoVO = this.cstBscInfoService.selectById(prjBscInfoVO.getCstId());
        if(null != cstBscInfoVO ){
            String certNo = cstBscInfoVO.getCertNo();
            view.addObject("certNo", certNo); // 证件号码
        }
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        // 月收入
        view.addObject("monIncmYuan", 0);
        if(null != prjBscInfoVO.getCstId()) {
            if(null != cstNpBscInfoVO && null != cstNpBscInfoVO.getYrInc()) {
                Long yrInc = cstNpBscInfoVO.getYrInc() ;
                String monIncmYuan = String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(yrInc), 12, 0));
                view.addObject("monIncmYuan", monIncmYuan); // 月收入
                // 客户基本信息和自然人信息
                String certValidSDt = cstNpBscInfoVO.getCertValidSDt(); // 证件有效起始日期
                String certValidEDt = cstNpBscInfoVO.getCertValidEDt(); // 证件有效终止日期
                view.addObject("certValidSDt", certValidSDt == null ? "" : certValidSDt);
                view.addObject("certValidEDt", certValidEDt == null ? "" : certValidEDt);
            }
        }
        // 查询支持的银行列表
        List<KeyValueVO> bankList = this.prjCstAccInfoService.searchCdList(PrjCstAccInfoConstant.CODE_SQ_SUPPORT_BANK_CD);
        for (KeyValueVO keyValueVO : bankList) {
            String key = keyValueVO.getKey();
            if(key.equals("POST")){
                view.addObject("bkCd",keyValueVO.getKey());
                view.addObject("bkNm",keyValueVO.getValue());
            }
        }
        view.addObject("bankList",bankList);
        resultVO.setData(view);
        return resultVO;
    }

    /**
     * 转向填写资管资料页面 苏宁银行
     * @param request
     * @param view   viewOfPrjBscInfoEditPageForSNBANKS
     * @param prjBscInfoVO
     */
    private DataResultVO viewOfPrjBscInfoEditPageForSNBANKS(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");

        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setCstId(prjBscInfoVO.getCstId());
        prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForSNBANKS", "根据cstID和insCode获取账户信息cstID==："+prjBscInfoVO.getCstId()+"==insCode==："+prjBscInfoVO.getInsCode());
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForSNBANKS", "根据cstID和insCode获取账户信息" + JSON.toJSONString(prjCstAccInfoVOS));
        PrjCstAccInfoVO vo = null ;
        if(CollectionUtils.isNotEmpty(prjCstAccInfoVOS)){
            for (PrjCstAccInfoVO prjCstAccInfoVO : prjCstAccInfoVOS) {
                if (Objects.equals(prjBscInfoVO.getId(), prjCstAccInfoVO.getPrjId())) {
                    //该项目已存在客户信息 返回前台
                    vo = prjCstAccInfoVO;
                    break;
                }
            }
            if (null == vo) {
                //优先获取开户成功并签约的数据
                /*for (PrjCstAccInfoVO prjCstAccInfoVO : prjCstAccInfoVOS) {
                    //判断该机构下该客户是否有开户成功并存在签约协议号的信息 有则返回 并绑定当前项目新增一条
                    if (null != prjCstAccInfoVO.getInsAccNo() && null != prjCstAccInfoVO.getBkCd()
							&& StringUtils.isNotBlank(prjCstAccInfoVO.getSignAgreementNo())) {
                        vo = prjCstAccInfoVO;
                        break;
                    }
                }*/
                //次选开户成功未签约的数据
                if(null == vo){
                    for (PrjCstAccInfoVO prjCstAccInfoVO : prjCstAccInfoVOS) {
                        //判断该机构下该客户是否有开户成功的信息 有则返回 并绑定当前项目新增一条
                        if (null != prjCstAccInfoVO.getInsAccNo() && null != prjCstAccInfoVO.getBkCd()) {
                            vo = prjCstAccInfoVO;
                            break;
                        }
                    }
                }
               /* if(null == vo){
					for (PrjCstAccInfoVO prjCstAccInfoVO : prjCstAccInfoVOS) {
						//判断该机构下该客户是否有 签约协议号 复制
						if (StringUtils.isNotBlank(prjCstAccInfoVO.getSignAgreementNo()) && null != prjCstAccInfoVO.getBkCd()) {
							vo = prjCstAccInfoVO;
							break;
						}
					}
				}*/
                if (null != vo) {
                    vo.setId(null);
                    vo.setPrjId(Long.valueOf(prjBscInfoVO.getId()));
                    vo.setCrtTm(new Date());
                    vo.setMdfTm(new Date());
                    vo.setIsDel(BaseConstant.IS_YESNO_NO);
                    Long add = this.prjCstAccInfoService.add(vo);
                    vo.setId(add);
                }
            }
        }
        if (null != vo) {
            //开户结果 只定义了开户成功 和 开户中
            Map<String, String> resMap = this.sysDictionaryApiService.searchGroupToMap(CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd(), DictionaryConstant.SNBANKS_ACC_RES_CD);
            if (null == vo.getAccResCd()) {
                vo.setAccResCd("未开户");
            } else {
                if (resMap.containsKey(vo.getAccResCd())) {
                    vo.setAccResCd(resMap.get(vo.getAccResCd()));
                } else {
                    vo.setAccResCd("开户失败");
                    view.addObject("accResMsg", vo.getAccResMsg());//开户结果描述
                }
            }
        } else  {
            //匹配的账户信息 填充信息
            vo = new PrjCstAccInfoVO();
            vo.setPrjId(prjBscInfoVO.getId());
            vo.setCstId(prjBscInfoVO.getCstId());
            vo.setCstNm(prjBscInfoVO.getCstNm());
            vo.setCertNo(prjBscInfoVO.getCertNo());
            vo.setInsCode(prjBscInfoVO.getInsCode());
            vo.setAccResCd("未开户");
        }
        view.addObject("cstAccInfoId", vo.getId()); // 项目客户账号信息主键
        view.addObject("cstId", vo.getCstId()); // 客户ID
        view.addObject("prjId", vo.getPrjId()); // 项目ID
        view.addObject("bkNm", vo.getBkNm()); // 银行名称
        view.addObject("bkCd", vo.getBkCd()); // 银行代码
        view.addObject("accNo", vo.getAccNo()); // 银行账号
        view.addObject("mp", vo.getMp()); // 银行卡绑定手机号
        view.addObject("cstNm", vo.getCstNm()); // 客户名称
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        view.addObject("insAccNo", vo.getInsAccNo() ); // 机构户头账户号 (2类账户)
        view.addObject("openId", vo.getOpenId() ); // 用户唯一标识
        view.addObject("certValidSDt", vo.getCertValidSDt());
        view.addObject("certValidEDt", vo.getCertValidEDt());
        view.addObject("insCode", vo.getInsCode());//机构code
        view.addObject("certNo", prjBscInfoVO.getCertNo());//身份证号
        view.addObject("accResCd", vo.getAccResCd());//开户结果

        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        if(null != prjBscInfoVO.getCstId()) {
            if(null != cstNpBscInfoVO) {
                String certValidSDt = cstNpBscInfoVO.getCertValidSDt(); // 证件有效起始日期
                String certValidEDt = cstNpBscInfoVO.getCertValidEDt(); // 证件有效终止日期
                view.addObject("lssueOffice", cstNpBscInfoVO.getIssuingOrg());//签发机关
                view.addObject("certValidSDt", certValidSDt == null ? "" : certValidSDt);
                view.addObject("certValidEDt", certValidEDt == null ? "" : certValidEDt);
                view.addObject("postProvince", cstNpBscInfoVO.getPostProvince());
                view.addObject("postCity", cstNpBscInfoVO.getPostCity());
                view.addObject("postAddr", cstNpBscInfoVO.getPostAddr());
            }
        }
        List<KeyValueVO> list = getBankList(PrjBscInfoConstant.PRJ_INS_CODE_SNBANKS);
        view.addObject("bankList",list);
        resultVO.setData(view);
        return resultVO;
    }


    /**
     * 转向填写资管资料页面 微众银行
     * @param request
     * @param view   viewOfPrjBscInfoEditPageForWEBANK
     * @param prjBscInfoVO
     */
    private DataResultVO viewOfPrjBscInfoEditPageForWEBANK(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");

        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForWEBANK", "根据prjId获取账户信息："+prjBscInfoVO.getId());
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForWEBANK", "根据prjId获取账户信息" + JSON.toJSONString(prjCstAccInfoVOS));
        PrjCstAccInfoVO vo = new PrjCstAccInfoVO();
        if(CollectionUtils.isNotEmpty(prjCstAccInfoVOS)){
            vo = prjCstAccInfoVOS.get(0);
        }
        //查询 纳税居民申明 字典
        List<KeyValueVO> taxResDecCdList = this.sysDictionaryApiService.getKvList(DictionaryConstant.TAX_RES_DEC_CD, CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd());

        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForWEBANK", "根据ID查询自然人客户基本信息请求==" + prjBscInfoVO.getCstId());
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForWEBANK", "根据ID查询自然人客户基本信息返回==cstNpBscInfoDTO" + JSON.toJSONString(cstNpBscInfoVO));
        String monthInc = null;
        String taxResDecCd = null;
        if (null != cstNpBscInfoVO) {
            Long yrInc = cstNpBscInfoVO.getYrInc();
            if (null != yrInc) {
                //年收入 / 12 / 100 转元 得到 月收入（元）
                monthInc = String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(yrInc), 12D));
            }
            //纳税居民申明
            taxResDecCd = cstNpBscInfoVO.getRatepayingState();
        }

        SysUlFilesRecQueryCondition condition = new SysUlFilesRecQueryCondition();
        condition.setPkId(prjBscInfoVO.getId().toString());
        condition.setSysCd(PropertiesCacheUtils.getProperty(SystemConstant.FL_SERVICE_CD));//系统代码
        condition.setOrgCd(CurrentThreadContext.getCurrentOrgCd());
        condition.setCfgCd(PrjBscInfoConstant.CODE_PRJ_FILE_CD);
        condition.setCfgDtlCd(PrjCstBscInfoConstant.CODE_WEBANK_MGT_CONT_CD);
        List<SysUlFilesRecDTO> recList = this.uploadApiService.searchSysUlFilesRecList(condition);

        if (CollectionUtils.isNotEmpty(recList)) {
            ArrayList<Long> fileIds = new ArrayList<>(recList.size());
            for (SysUlFilesRecDTO sysUlFilesRecDTO : recList) {
                fileIds.add(sysUlFilesRecDTO.getId());
            }
            view.addObject("fileIds", fileIds); //附件Ids
        }

        view.addObject("cstAccInfoId", vo.getId()); // 项目客户账号信息主键
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("bkNm", vo.getBkNm()); // 银行名称
        //view.addObject("bkNo", vo.getBkNo()); // 开户行号
        view.addObject("bkCd", vo.getBkCd()); // 银行代码
        view.addObject("accNo", vo.getAccNo()); // 银行账号
        view.addObject("mp", vo.getMp()); // 银行卡绑定手机号
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code
        view.addObject("certNo", prjBscInfoVO.getCertNo());//身份证号
        view.addObject("monthInc", monthInc);//月收入
        view.addObject("taxResDecCd", taxResDecCd);//纳税居民声明
        view.addObject("taxResDecCdList", taxResDecCdList);//纳税居民声明 列表
        view.addObject("rgnPrCd", prjBscInfoVO.getRgnPrCd());//省
        view.addObject("rgnCyCd", prjBscInfoVO.getRgnCyCd());//市

        List<KeyValueVO> list = getBankList(PrjBscInfoConstant.PRJ_INS_CODE_WEBANK);
        view.addObject("bankList",list);
        resultVO.setData(view);
        return resultVO;
    }


    /**
     * 转向填写资管资料页面 天津银行
     * @param request
     * @param view   viewOfPrjBscInfoEditPageForTJBANK
     * @param prjBscInfoVO
     */
    private DataResultVO viewOfPrjBscInfoEditPageForTJBANK(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");

        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForTJBANK", "根据prjId获取账户信息："+prjBscInfoVO.getId());
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForTJBANK", "根据prjId获取账户信息" + JSON.toJSONString(prjCstAccInfoVOS));
        PrjCstAccInfoVO vo = new PrjCstAccInfoVO();
        if(CollectionUtils.isNotEmpty(prjCstAccInfoVOS)){
            vo = prjCstAccInfoVOS.get(0);
        }

        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForTJBANK", "根据ID查询自然人客户基本信息请求==" + prjBscInfoVO.getCstId());
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForTJBANK", "根据ID查询自然人客户基本信息返回==cstNpBscInfoDTO" + JSON.toJSONString(cstNpBscInfoVO));
        String monthInc = null;
        String certValidSDt = null;
        String certValidEDt = null;
        String rgnPrCd = null;
        String rgnCyCd = null;
        String rgnCountyCd = null;
        String domicileProvinceNm = null;
        String domicleCityNm = null;
        String postAddr = null;
        if (null != cstNpBscInfoVO) {
            certValidSDt = cstNpBscInfoVO.getCertValidSDt();
            certValidEDt = cstNpBscInfoVO.getCertValidEDt();
            rgnPrCd = cstNpBscInfoVO.getDomicileProvince();
            rgnCyCd = cstNpBscInfoVO.getDomicleCity();
            rgnCountyCd = cstNpBscInfoVO.getDomicleCounty();
            postAddr = cstNpBscInfoVO.getPostAddr();
            Long yrInc = cstNpBscInfoVO.getYrInc();
            if (null != yrInc) {
                //年收入 / 12 / 100 转元 得到 月收入（元）
                monthInc = String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(yrInc), 12D));
                BigDecimal decimal = new BigDecimal(monthInc);
                monthInc = decimal.toPlainString();
            }
        }

        view.addObject("cstAccInfoId", vo.getId()); // 项目客户账号信息主键
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("bkNm", vo.getBkNm()); // 银行名称
        view.addObject("bkCd", vo.getBkCd()); // 银行代码
        view.addObject("accNo", vo.getAccNo()); // 银行账号
        view.addObject("mp", vo.getMp()); // 银行卡绑定手机号
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code
        view.addObject("certNo", prjBscInfoVO.getCertNo());//身份证号
        view.addObject("monthInc", monthInc);//月收入
        view.addObject("postAddr", postAddr);//客户居住地址
        view.addObject("rgnPrCd", rgnPrCd);//省
        view.addObject("rgnCyCd", rgnCyCd);//市
        view.addObject("rgnCountyCd", rgnCountyCd);//县
        view.addObject("certValidSDt", certValidSDt);
        view.addObject("certValidEDt", certValidEDt);

        List<KeyValueVO> list = getBankList(PrjBscInfoConstant.PRJ_INS_CODE_TJBANK);
        view.addObject("bankList",list);
        resultVO.setData(view);
        return resultVO;
    }

    /**
     * 转向填写资管资料页面 江西金租
     * @param request
     * @param view   viewOfPrjBscInfoEditPageForJXFL
     * @param prjBscInfoVO
     */
    private void viewOfPrjBscInfoEditPageForJXFL (HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");

        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setInsCode(PrjBscInfoConstant.PRJ_INS_CODE_JXFL);
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForJXFL", "根据prjId获取账户信息："+prjBscInfoVO.getId());
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForJXFL", "根据prjId获取账户信息" + JSON.toJSONString(prjCstAccInfoVOS));
        PrjCstAccInfoVO vo = new PrjCstAccInfoVO();
        // 复制绑卡成功信息
        if(CollectionUtils.isEmpty(prjCstAccInfoVOS)){
            PrjCstAccInfoQueryCondition prjCstAccInfoQueryCondition = new PrjCstAccInfoQueryCondition();
            prjCstAccInfoQueryCondition.setCstId(prjBscInfoVO.getCstId());
            prjCstAccInfoQueryCondition.setIsDel(BaseConstant.IS_YESNO_NO);
            prjCstAccInfoQueryCondition.setInsCode(PrjBscInfoConstant.PRJ_INS_CODE_JXFL);
            BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForJXFL", "根据cstId获取账户信息："+prjBscInfoVO.getCstId());
            prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQueryCondition);
            BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForJXFL", "根据cstId获取账户信息" + JSON.toJSONString(prjCstAccInfoVOS));
            PrjCstAccInfoVO prjCstAccInfoVO = null;
            if(CollectionUtils.isNotEmpty(prjCstAccInfoVOS)){
                for (PrjCstAccInfoVO pcai : prjCstAccInfoVOS) {
                    // 0 ： 未绑卡 ； 1 ： 已绑定银联 ； 2 ： 全部绑卡成功 （必须先绑成功银联才能绑易宝）
                    if(StringUtils.isNotEmpty(pcai.getAccResCd()) && "2".equals(pcai.getAccResCd())){
                        // 查询项目是否已删除
                        PrjBscInfoQueryCondition prjBscInfoQC = new PrjBscInfoQueryCondition();
                        prjBscInfoQC.setId(pcai.getPrjId());
                        prjBscInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
                        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForJXFL", "根据prjId获取项目信息："+prjBscInfoQC.getId());
                        List<PrjBscInfoVO> prjBscInfoVOS = this.prjBscInfoService.searchPrjBscInfoList(prjBscInfoQC);
                        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForJXFL", "根据prjId获取项目信息" + JSON.toJSONString(prjBscInfoVOS));
                        if(CollectionUtils.isEmpty(prjBscInfoVOS)){
                            continue;
                        }
                        prjCstAccInfoVO = pcai;
                        break;
                    }
                }
                // if(null == prjCstAccInfoVO){
                //     for (PrjCstAccInfoVO pcai : prjCstAccInfoVOS) {
                //         // 0 ： 未绑卡 ； 1 ： 已绑定银联 ； 2 ： 全部绑卡成功 （必须先绑成功银联才能绑易宝）
                //         if(StringUtils.isNotEmpty(pcai.getAccResCd()) && "1".equals(pcai.getAccResCd())){
                //             prjCstAccInfoVO = pcai;
                //             break;
                //         }
                //     }
                // }
            }
            if(null != prjCstAccInfoVO){
                prjCstAccInfoVO.setId(null);
                prjCstAccInfoVO.setPrjId(Long.valueOf(prjBscInfoVO.getId()));
                prjCstAccInfoVO.setCrtTm(new Date());
                prjCstAccInfoVO.setMdfTm(new Date());
                prjCstAccInfoVO.setIsDel(BaseConstant.IS_YESNO_NO);
                prjCstAccInfoVO.setInsCode(prjBscInfoVO.getInsCode());
                // 复制绑卡成功信息
                BaseLogUtils.info(logger,"viewOfPrjBscInsEditPageForSPD","新增江西金租复制客户账户开始=="+JSON.toJSONString(prjCstAccInfoVO));
                Long add = this.prjCstAccInfoService.add(prjCstAccInfoVO);
                BaseLogUtils.info(logger,"viewOfPrjBscInsEditPageForSPD","新增江西金租复制客户账户完成=="+prjBscInfoVO.getId()+"，add="+add);
                prjCstAccInfoVO.setId(add);
                vo = prjCstAccInfoVO;
            }
        }else{
            vo = prjCstAccInfoVOS.get(0);
        }

        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForJXFL", "根据ID查询自然人客户基本信息请求==" + prjBscInfoVO.getCstId());
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForJXFL", "根据ID查询自然人客户基本信息返回==cstNpBscInfoDTO" + JSON.toJSONString(cstNpBscInfoVO));

        String monthInc = "";
        String homeAddr = "";
        String postAddr = "";
        String idAddr = "";
        String certValidSDt = "";
        String certValidEDt = "";
        if(null != cstNpBscInfoVO){
            if (null != cstNpBscInfoVO.getYrInc()) {
                monthInc = String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(cstNpBscInfoVO.getYrInc()), 12D));
            }
            homeAddr = cstNpBscInfoVO.getHomeAddr();
            postAddr = cstNpBscInfoVO.getPostAddr();
            idAddr = cstNpBscInfoVO.getIdAddr();
            certValidSDt = cstNpBscInfoVO.getCertValidSDt();
            certValidEDt = cstNpBscInfoVO.getCertValidEDt();
        }
        view.addObject("monthInc", monthInc);// 月收入
        // 家庭地址-现居住地详细地址
        view.addObject("homeAddr", homeAddr);
        // 通讯地址
        view.addObject("postAddr", postAddr);
        // 身份证地址-户籍地址
        view.addObject("idAddr", idAddr);
        // 证件有效起始日期
        view.addObject("certValidSDt", certValidSDt);
        // 证件有效截止日期
        view.addObject("certValidEDt", certValidEDt);

        view.addObject("cstAccInfoId", vo.getId()); // 项目客户账号信息主键
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("bkNm", vo.getBkNm()); // 银行名称
        view.addObject("bkNo", vo.getBkNo()); // 开户行号
        view.addObject("bkCd", vo.getBkCd()); // 银行代码
        view.addObject("accNo", vo.getAccNo()); // 银行账号
        view.addObject("mp", vo.getMp()); // 银行卡绑定手机号
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code
        view.addObject("certNo", prjBscInfoVO.getCertNo());//身份证号
        view.addObject("accResCd", StringUtils.isNotBlank(vo.getAccResCd()) ? vo.getAccResCd() : "0");// 绑卡信息    0 ： 未绑卡 ； 1 ： 已绑定银联 ； 2 ： 全部绑卡成功 （必须先绑成功银联才能绑易宝）
        // 四要素校验信息
        view.addObject("chkRstCd", StringUtils.isNotBlank(vo.getChkRstCd()) ? vo.getChkRstCd() : SysInsCfgInfoConstant.CODE_CST_AUTH_RST_CD_0);

        SysCdMapDQueryCondition cdMapDQC = new SysCdMapDQueryCondition();
        cdMapDQC.setSysCd(WebBaseConstant.SYS_SYS_CD);
        cdMapDQC.setOrgCd(CurrentThreadContext.getCurrentOrgCd());
        cdMapDQC.setmTypCd("M1041");
        cdMapDQC.setTCode(PrjBscInfoConstant.PRJ_INS_CODE_JXFL);

        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForJXFL", "查询还款银行信息==cdMapDQC" + JSON.toJSONString(cdMapDQC));
        List<SysCdMapDDTO> sysCdMapDList =  this.sysCdMapApiService.searchSysCdMapDWithTargetList(cdMapDQC);
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForJXFL", "查询还款银行信息返回==sysCdMapDList" + JSON.toJSONString(sysCdMapDList));

        List<KeyValueVO> list =  new ArrayList<>();
        JSONObject singleQuotaMap = new JSONObject();
        if (CollectionUtils.isNotEmpty(sysCdMapDList)) {
            for(SysCdMapDDTO sysCdMapDDTO : sysCdMapDList) {
                KeyValueVO kv = new KeyValueVO();
                kv.setKey(sysCdMapDDTO.getSCode());
                kv.setValue(sysCdMapDDTO.getSCodeNm());
                list.add(kv);
                singleQuotaMap.put(sysCdMapDDTO.getSCode(), sysCdMapDDTO.getCodeAttr1()); // 单笔限额
            }
        }
        view.addObject("bankList",list);
        String singleQuota = "";
        if(StringUtils.isNotBlank(vo.getBkCd())){
            singleQuota = singleQuotaMap.getString(vo.getBkCd());
        }
        view.addObject("singleQuota", singleQuota);
        view.addObject("singleQuotaMap",singleQuotaMap);
        resultVO.setData(view);
    }



    /**
     * 转向填写资管资料页面 上海银行股份有限公司福民支行
     * @param request
     * @param view   viewOfPrjBscInfoEditPageForFMBANK
     * @param prjBscInfoVO
     */
    private DataResultVO viewOfPrjBscInfoEditPageForSHBANK(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");
        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForSHBANK", "根据prjId获取账户信息：" + prjBscInfoVO.getId());
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForSHBANK", "根据prjId获取账户信息" + JSON.toJSONString(prjCstAccInfoVOS));
        PrjCstAccInfoVO vo = new PrjCstAccInfoVO();
        if(CollectionUtils.isNotEmpty(prjCstAccInfoVOS)){
            vo = prjCstAccInfoVOS.get(0);
        }
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForSHBANK", "根据ID查询自然人客户基本信息返回==cstNpBscInfoDTO" + JSON.toJSONString(cstNpBscInfoVO));
        String monthInc = "";
        if (null != cstNpBscInfoVO && null != cstNpBscInfoVO.getYrInc()) {
            Long yrInc = cstNpBscInfoVO.getYrInc();
            monthInc = String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(yrInc), 12D));
        }
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("certNo", prjBscInfoVO.getCertNo());//身份证号
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        view.addObject("cstAccInfoId", vo.getId()); // 项目客户账号信息主键
        view.addObject("bkNm", vo.getBkNm()); // 银行名称
        view.addObject("bkCd", vo.getBkCd()); // 银行代码
        view.addObject("accNo", vo.getAccNo()); // 银行账号
        view.addObject("mp", vo.getMp()); // 银行卡绑定手机号
        view.addObject("monthInc", monthInc);//月收入
        view.addObject("isWorkExp",cstNpBscInfoVO.getIsWorkExp());//是否有从业经验
        view.addObject("idAddr",cstNpBscInfoVO.getIdAddr());//户籍地址

        List<KeyValueVO> list = getBankList(PrjBscInfoConstant.PRJ_INS_CODE_SHBANK);
        view.addObject("bankList",list);
        resultVO.setData(view);
        return resultVO;
    }

    /**
     * 转向填写资管资料页面 北京中关村银行股份有限公司
     * @param request
     * @param view
     * @param prjBscInfoVO
     */
    private void viewOfPrjBscInfoEditPageForZGCBANK(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");

        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForZGCBANK", "根据prjId获取账户信息："+prjBscInfoVO.getId());
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForZGCBANK", "根据prjId获取账户信息" + JSON.toJSONString(prjCstAccInfoVOS));
        PrjCstAccInfoVO vo = new PrjCstAccInfoVO();
        if (CollectionUtils.isEmpty(prjCstAccInfoVOS)) {
            PrjCstAccInfoQueryCondition prjCstAccInfoQueryCondition = new PrjCstAccInfoQueryCondition();
            prjCstAccInfoQueryCondition.setCstId(prjBscInfoVO.getCstId());
            prjCstAccInfoQueryCondition.setInsCode(PrjBscInfoConstant.PRJ_INS_CODE_ZGCBANK);
            BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForZGCBANK", "根据cstId获取账户信息：" + prjBscInfoVO.getCstId());
            prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQueryCondition);
            BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForZGCBANK", "根据cstId获取账户信息" + JSON.toJSONString(prjCstAccInfoVOS));
            PrjCstAccInfoVO prjCstAccInfoVO = null;
            if (CollectionUtils.isNotEmpty(prjCstAccInfoVOS)) {
                for (PrjCstAccInfoVO pcai : prjCstAccInfoVOS) {
                    // 0 ： 未绑卡 ； 1 ： 绑卡成功
                    if (StringUtils.isNotEmpty(pcai.getAccResCd()) && "1".equals(pcai.getAccResCd())) {
                        prjCstAccInfoVO = pcai;
                        break;
                    }
                }
            }
            if (null != prjCstAccInfoVO) {
                prjCstAccInfoVO.setId(null);
                prjCstAccInfoVO.setPrjId(Long.valueOf(prjBscInfoVO.getId()));
                prjCstAccInfoVO.setCrtTm(new Date());
                prjCstAccInfoVO.setMdfTm(new Date());
                prjCstAccInfoVO.setIsDel(BaseConstant.IS_YESNO_NO);
                prjCstAccInfoVO.setInsCode(prjBscInfoVO.getInsCode());
                // 复制绑卡成功信息
                BaseLogUtils.info(logger,"viewOfPrjBscInfoEditPageForZGCBANK","新增中关村银行复制客户账户开始=="+JSON.toJSONString(prjCstAccInfoVO));
                Long add = this.prjCstAccInfoService.add(prjCstAccInfoVO);
                BaseLogUtils.info(logger,"viewOfPrjBscInfoEditPageForZGCBANK","新增中关村银行复制客户账户完成=="+prjBscInfoVO.getId()+"，add="+add);
                prjCstAccInfoVO.setId(add);
                vo = prjCstAccInfoVO;
            }
        } else {
            vo = prjCstAccInfoVOS.get(0);
        }

        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForZGCBANK", "根据ID查询自然人客户基本信息请求==" + prjBscInfoVO.getCstId());
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForZGCBANK", "根据ID查询自然人客户基本信息返回==cstNpBscInfoDTO" + JSON.toJSONString(cstNpBscInfoVO));
        String monthInc = "";
        String certValidEDt = "";
        String certValidSDt = "";
        if(null != cstNpBscInfoVO){
            // 月收入
            if (null != cstNpBscInfoVO.getYrInc()) {
                monthInc = String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(cstNpBscInfoVO.getYrInc()), 12D));
            }
            if (null != cstNpBscInfoVO.getCertValidEDt()) certValidEDt = cstNpBscInfoVO.getCertValidEDt();
            if (null != cstNpBscInfoVO.getCertValidSDt()) certValidSDt = cstNpBscInfoVO.getCertValidSDt();
        }
        view.addObject("certValidSDt", certValidSDt);
        view.addObject("certValidEDt", certValidEDt);
        view.addObject("monthInc", monthInc);
        view.addObject("cstAccInfoId", vo.getId()); // 项目客户账号信息主键
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("bkNm", vo.getBkNm()); // 银行名称
        view.addObject("bkNo", vo.getBkNo()); // 开户行号
        view.addObject("accNo", vo.getAccNo()); // 银行账号
        view.addObject("mp", vo.getMp()); // 银行卡绑定手机号
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code
        view.addObject("certNo", prjBscInfoVO.getCertNo());//身份证号
        view.addObject("accResCd", StringUtils.isNotBlank(vo.getAccResCd()) ? vo.getAccResCd() : "0");//开户信息
        view.addObject("chkRstCd", StringUtils.isNotBlank(vo.getChkRstCd()) ? vo.getChkRstCd() : "0");
        view.addObject("accResCdS", "1".equals(StringUtils.isNotBlank(vo.getAccResCd()) ? vo.getAccResCd() : "0") ? "已开户" : "未开户");

        SysCdMapDQueryCondition cdMapDQC = new SysCdMapDQueryCondition();
        cdMapDQC.setSysCd(WebBaseConstant.SYS_SYS_CD);
        cdMapDQC.setOrgCd(CurrentThreadContext.getCurrentOrgCd());
        cdMapDQC.setmTypCd("M1041");
        cdMapDQC.setTCode(PrjBscInfoConstant.PRJ_INS_CODE_ZGCBANK);
        List<SysCdMapDDTO> sysCdMapDList =  this.sysCdMapApiService.searchSysCdMapDWithTargetList(cdMapDQC);
        List<KeyValueVO> list =  new ArrayList<>();
        JSONObject singleQuotaMap = new JSONObject();
        String bkCd = vo.getBkCd();
        if (CollectionUtils.isNotEmpty(sysCdMapDList)) {
            for(SysCdMapDDTO sysCdMapDDTO : sysCdMapDList) {
                KeyValueVO kv = new KeyValueVO();
                kv.setKey(sysCdMapDDTO.getSCode());
                kv.setValue(sysCdMapDDTO.getSCodeNm());
                list.add(kv);
                singleQuotaMap.put(sysCdMapDDTO.getSCode(), sysCdMapDDTO.getCodeAttr1()); // 单笔限额
                if (StringUtils.isBlank(bkCd) && StringUtils.isNotBlank(vo.getBkNm()) && null != sysCdMapDDTO
                        && StringUtils.isNotBlank(sysCdMapDDTO.getSCodeNm()) && vo.getBkNm().equals(sysCdMapDDTO.getSCodeNm())) {
                    bkCd = sysCdMapDDTO.getSCode();
                }
            }
        }
        view.addObject("bkCd", bkCd); // 银行代码
        view.addObject("bankList",list);
        String singleQuota = "";
        if(StringUtils.isNotBlank(bkCd)){
            singleQuota = singleQuotaMap.getString(bkCd);
        }
        view.addObject("singleQuota", singleQuota);
        view.addObject("singleQuotaMap",singleQuotaMap);
        resultVO.setData(view);
    }

    /**
     * 转向填写资管资料页面 宜宾银行查询项目客户账户信息
     */
    public DataResultVO viewOfPrjBscInfoEditPageForYBBANK(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForYBBANK", "宜宾银行查询项目客户账户信息", CurrentThreadContext.getCurrentUserName());
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "宜宾银行查询项目客户账户信息查询成功");
        Long prjId = prjBscInfoVO.getId();
        if (StringUtils.isEmpty(prjId)) {
            return new DataResultVO(BaseConstant.IS_YESNO_NO, "项目ID为空!");
        }
        try {
            PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
            prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
            prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
            prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
            BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForYBBANK", "根据prjId获取账户信息："+prjBscInfoVO.getId());
            List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
            BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForYBBANK", "根据prjId获取账户信息" + JSON.toJSONString(prjCstAccInfoVOS));
            PrjCstAccInfoVO vo = new PrjCstAccInfoVO();
            if(CollectionUtils.isNotEmpty(prjCstAccInfoVOS)){
                vo = prjCstAccInfoVOS.get(0);
            }

            BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForYBBANK", "根据ID查询自然人客户基本信息请求==cstId:" + prjBscInfoVO.getCstId());
            CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
            BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForYBBANK", "根据ID查询自然人客户基本信息返回==cstNpBscInfoVO:" + JSON.toJSONString(cstNpBscInfoVO));
            String monthInc = null;
            String certValidSDt = null;
            String certValidEDt = null;
            String rgnPrCd = null;
            String rgnCyCd = null;
            String rgnCountyCd = null;
            String idAddr = null;
            String nation = null;

            if (null != cstNpBscInfoVO) {
                certValidSDt = cstNpBscInfoVO.getCertValidSDt();
                certValidEDt = cstNpBscInfoVO.getCertValidEDt();
                rgnPrCd = cstNpBscInfoVO.getDomicileProvince();
                rgnCyCd = cstNpBscInfoVO.getDomicleCity();
                rgnCountyCd = cstNpBscInfoVO.getDomicleCounty();
                idAddr = cstNpBscInfoVO.getIdAddr();
                nation = cstNpBscInfoVO.getNation();
                Long yrInc = cstNpBscInfoVO.getYrInc();
                if (null != yrInc) {
                    //年收入 / 12 / 100 转元 得到 月收入（元）
                    monthInc = String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(yrInc), 12D));
                    BigDecimal decimal = new BigDecimal(monthInc);
                    monthInc = decimal.toPlainString();
                }
            }

            //区域 省 市 县
            if (StringUtils.isNotEmpty(rgnPrCd)) {
                SysRegionVO sysRegionVO = this.sysRegionService.getRegionByRgnCd(rgnPrCd);
                if(null != sysRegionVO && StringUtils.isNotEmpty(sysRegionVO.getRgnNm())){
                    view.addObject("domicileProvinceNm", sysRegionVO.getRgnNm());//省
                    idAddr = idAddr.replaceFirst(sysRegionVO.getRgnNm(), "");
                }
            }
            if (StringUtils.isNotEmpty(rgnCyCd)) {
                SysRegionVO sysRegionVO = this.sysRegionService.getRegionByRgnCd(rgnCyCd);
                if(null != sysRegionVO && StringUtils.isNotEmpty(sysRegionVO.getRgnNm())){
                    view.addObject("domicleCityNm", sysRegionVO.getRgnNm());//市
                    idAddr = idAddr.replaceFirst(sysRegionVO.getRgnNm(), "");
                }
            }
            if (StringUtils.isNotEmpty(rgnCountyCd)) {
                SysRegionVO sysRegionVO = this.sysRegionService.getRegionByRgnCd(rgnCountyCd);
                if(null != sysRegionVO && StringUtils.isNotEmpty(sysRegionVO.getRgnNm())){
                    view.addObject("domicleCountyNm", sysRegionVO.getRgnNm());//县
                    idAddr = idAddr.replaceFirst(sysRegionVO.getRgnNm(), "");
                }
            }
            //查询宜宾-民族配置
            List<KeyValueVO> ybbankNationCdList = this.sysDictionaryApiService.getKvList(DictionaryConstant.YBBANK_NATION_CD, CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd());
            view.addObject("ybbankNationCdList", ybbankNationCdList);

            view.addObject("cstAccInfoId", vo.getId()); // 项目客户账号信息主键
            view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
            view.addObject("bkNm", vo.getBkNm()); // 银行名称
            view.addObject("bkCd", vo.getBkCd()); // 银行代码
            view.addObject("accNo", vo.getAccNo()); // 银行账号
            view.addObject("mp", vo.getMp()); // 银行卡绑定手机号
            view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
            view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
            view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code
            view.addObject("certNo", prjBscInfoVO.getCertNo());//身份证号
            view.addObject("rgnPrCd", rgnPrCd);//户籍所在地-省
            view.addObject("rgnCyCd", rgnCyCd);//户籍所在地-市
            view.addObject("rgnCountyCd", rgnCountyCd);//户籍所在地-县
            view.addObject("idAddr", idAddr);//户籍所在地-详细地址
            view.addObject("nation", nation);//民族

            view.addObject("certValidSDt", certValidSDt);
            view.addObject("certValidEDt", certValidEDt);
            view.addObject("monthInc", monthInc); //月收入
            view.addObject("prjId", prjId);
            List<KeyValueVO> list = getBankList(PrjBscInfoConstant.PRJ_INS_CODE_YBBANK);
            view.addObject("bankList",list);
            resultVO.setData(view);

        } catch (BaseException ex) {
            resultVO.setSuccess(BaseConstant.IS_YESNO_NO);
            resultVO.setInfo(ex.getMessage());
            BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForYBBANK", "宜宾银行查询项目客户账户信息,prjId:" + prjId + ".ERROR:" + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
        } catch (Exception e) {
            resultVO.setSuccess(BaseConstant.IS_YESNO_NO);
            resultVO.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
            BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForYBBANK", "宜宾银行查询项目客户账户信息,prjId:" + prjId + ".ERROR:" + e.getMessage(), CurrentThreadContext.getCurrentUserName());
        }
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForYBBANK", "宜宾银行查询项目客户账户信息, prjId:" + prjId, "-耗时:" + (endTm - startTm));
        return resultVO;
    }

    /**
     * 转向填写资管资料页面 上海农村商业银行股份有限公司
     */
    private void viewOfPrjBscInfoEditPageForSHNSBANK(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");

        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForSHNSBANK", "根据prjId获取账户信息："+prjBscInfoVO.getId());
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForSHNSBANK", "根据prjId获取账户信息" + JSON.toJSONString(prjCstAccInfoVOS));
        PrjCstAccInfoVO vo = new PrjCstAccInfoVO();
        if(CollectionUtils.isNotEmpty(prjCstAccInfoVOS)){
            vo = prjCstAccInfoVOS.get(0);
            view.addObject("cstAccInfoId", vo.getId()); // 项目客户账号信息主键
            view.addObject("bkNm", vo.getBkNm()); // 银行名称
            view.addObject("bkNo", vo.getBkNo()); // 开户行号
            view.addObject("accNo", vo.getAccNo()); // 银行账号
            view.addObject("bkCd", vo.getBkCd()); // 银行代码
            view.addObject("mp", vo.getMp()); // 银行卡绑定手机号
        }

        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForSHNSBANK", "根据ID查询自然人客户基本信息请求==" + prjBscInfoVO.getCstId());
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForSHNSBANK", "根据ID查询自然人客户基本信息返回==cstNpBscInfoDTO" + JSON.toJSONString(cstNpBscInfoVO));
        String certValidEDt = "";
        String certValidSDt = "";
        if(null != cstNpBscInfoVO){
            if (null != cstNpBscInfoVO.getCertValidEDt()) certValidEDt = cstNpBscInfoVO.getCertValidEDt();
            if (null != cstNpBscInfoVO.getCertValidSDt()) certValidSDt = cstNpBscInfoVO.getCertValidSDt();
            view.addObject("nation", cstNpBscInfoVO.getNation());
            view.addObject("rgnPrCd2", cstNpBscInfoVO.getPostProvince());//居住地省
            view.addObject("rgnCyCd2", cstNpBscInfoVO.getPostCity());//居住地市
        }
        view.addObject("certValidSDt", certValidSDt);
        view.addObject("certValidEDt", certValidEDt);
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code
        view.addObject("certNo", prjBscInfoVO.getCertNo());//身份证号

        List<KeyValueVO> nationList = sysDictionaryApiService.getKvList("CST0060", "11000", "0000");
        view.addObject("nationList", nationList);
        //查询支持的银行列表
        List<KeyValueVO> list =  new ArrayList<>();
        DataResultDTO supportBankList = shnsbanksInsApiService.getSupportBankList(prjBscInfoVO.getFundRasInsId(), prjBscInfoVO.getId());
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForSHNSBANK", "支持银行列表="+JSONObject.toJSONString(supportBankList));
        if (supportBankList != null && supportBankList.getData() != null) {
            Map<String,String> map = (Map<String, String>) supportBankList.getData();
            for (Map.Entry<String, String> banks : map.entrySet()) {
                KeyValueVO kv = new KeyValueVO();
                kv.setKey(banks.getKey());
                kv.setValue(banks.getValue());
                list.add(kv);
            }
        }
        view.addObject("bankList",list);
        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForSHNSBANK,进入页面=" + JSONObject.toJSONString(view)).info();
        resultVO.setData(view);
    }
    /**
     * @param request
     * @param view
     * @param prjBscInfoVO
     * @return void
     * @description 兴业金租 银行信息采集页查询
     * @author fuzq
     * @date 2020-02-14
     */
    private void viewOfPrjBscInfoEditPageForXYFL(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        //拿当前项目账户信息
        PrjCstAccInfoVO cstAccInfoVO = null;
        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setCstId(prjBscInfoVO.getCstId());
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        if (CollectionUtils.isNotEmpty(prjCstAccInfoVOS)){
            //查到当前项目并且成功的直接回显
            PrjCstAccInfoVO oldVo = prjCstAccInfoVOS.get(0);
            if (InsAccResEnum.SUCCESS.code.equals(oldVo.getAccResCd())) {
                cstAccInfoVO = oldVo;
            }
        }
        else {
            //没查到则拷贝历史成功的
            PrjCstAccInfoQueryCondition prjCstAccInfoQueryCondition = new PrjCstAccInfoQueryCondition();
            prjCstAccInfoQueryCondition.setCstId(prjBscInfoVO.getCstId());
            prjCstAccInfoQueryCondition.setIsDel(BaseConstant.IS_YESNO_NO);
            prjCstAccInfoQueryCondition.setAccResCd(InsAccResEnum.SUCCESS.code);
            prjCstAccInfoQueryCondition.setInsCode(prjBscInfoVO.getInsCode());
            List<PrjCstAccInfoVO> prjCstAccInfoVOList = this.prjCstAccInfoService.searchList(prjCstAccInfoQueryCondition);
            if (CollectionUtils.isNotEmpty(prjCstAccInfoVOList)){
                cstAccInfoVO = prjCstAccInfoVOList.get(0);
                //账户信息保存到当前项目下
                cstAccInfoVO.setId(null);
                cstAccInfoVO.setPrjId(Long.valueOf(prjBscInfoVO.getId()));
                cstAccInfoVO.setCrtTm(new Date());
                cstAccInfoVO.setMdfTm(new Date());
                cstAccInfoVO.setIsDel(BaseConstant.IS_YESNO_NO);
                cstAccInfoVO.setMdfUsrId(CurrentThreadContext.getCurrentUserId());
                Long add = this.prjCstAccInfoService.add(cstAccInfoVO);
                cstAccInfoVO.setId(add);
            }
        }
        //没有开户成功则返回当前
        if (null == cstAccInfoVO && CollectionUtils.isNotEmpty(prjCstAccInfoVOS)){
            cstAccInfoVO = prjCstAccInfoVOS.get(0);
        }
        BaseLogUtils.newServiceLogger("兴业金租-银行信息采集-返回账户信" + JSONObject.toJSONString(cstAccInfoVO)).info();
        if (null != cstAccInfoVO) {
            // 项目客户主键
            view.addObject("cstAccInfoId", cstAccInfoVO.getId());
            //是否绑卡成功
            view.addObject("accResCd", cstAccInfoVO.getAccResCd());
            // 银行名称
            view.addObject("bkNm", cstAccInfoVO.getBkNm());
            // 开户行号
            view.addObject("bkNo", cstAccInfoVO.getBkNo());
            // 银行账号
            view.addObject("accNo", cstAccInfoVO.getAccNo());
            // 银行卡绑定手机号
            view.addObject("mp", cstAccInfoVO.getMp());
            // 银行代码
            view.addObject("bkCd", cstAccInfoVO.getBkCd());
        }
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        String certValidEDt = "";
        if (null != cstNpBscInfoVO) {
            if (null != cstNpBscInfoVO.getCertValidEDt()) {
                certValidEDt = cstNpBscInfoVO.getCertValidEDt();
                //身份证有效截止日期
                view.addObject("certValidEDt", certValidEDt);
            }
            //居住地省
            view.addObject("rgnPrCd",cstNpBscInfoVO.getPostProvince());
            //居住地市
            view.addObject("rgnCyCd", cstNpBscInfoVO.getPostCity());
            //户籍地省
            view.addObject("rgnPrCd2", cstNpBscInfoVO.getDomicileProvince());
            //户籍地市
            view.addObject("rgnCyCd2", cstNpBscInfoVO.getDomicleCity());
            //月收入
            DecimalFormat df2 =new DecimalFormat("#.0");
            if (null !=cstNpBscInfoVO.getYrInc()){
                String result = df2.format(DecimalUtils.div(DecimalUtils.convertFenToYuan(cstNpBscInfoVO.getYrInc()),12));
                view.addObject("monthlyIncome",result );
            }
            //民族
            view.addObject("nation", cstNpBscInfoVO.getNation());
        }
        // 客户ID
        view.addObject("cstId", prjBscInfoVO.getCstId());
        //金融机构id
        view.addObject("fundRasInsId", prjBscInfoVO.getFundRasInsId());
        // 项目ID
        view.addObject("prjId", prjBscInfoVO.getId());
        // 客户名称
        view.addObject("cstNm", prjBscInfoVO.getCstNm());
        // 机构名称
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm());
        //机构code
        view.addObject("insCode", prjBscInfoVO.getInsCode());
        //身份证号
        view.addObject("certNo", prjBscInfoVO.getCertNo());
        //查询支持的银行列表
        List<KeyValueVO> list = new ArrayList<>();
        SysCdMapDQueryCondition cdMapDQC = new SysCdMapDQueryCondition();
        cdMapDQC.setSysCd(WebBaseConstant.SYS_SYS_CD);
        cdMapDQC.setOrgCd(CurrentThreadContext.getCurrentOrgCd());
        cdMapDQC.setmTypCd("M1041");
        cdMapDQC.setTCode(PrjBscInfoConstant.PRJ_INS_CODE_XYFL);
        String bkCd = "";
        if (null!=cstAccInfoVO){
            bkCd = cstAccInfoVO.getBkCd();
        }
        //金额列表
        List<SysCdMapDDTO> sysCdMapDList = this.sysCdMapApiService.searchSysCdMapDWithTargetList(cdMapDQC);
        JSONObject singleQuotaMap = new JSONObject();
        if (CollectionUtils.isNotEmpty(sysCdMapDList)) {
            for (SysCdMapDDTO sysCdMapDDTO : sysCdMapDList) {
                KeyValueVO kv = new KeyValueVO();
                kv.setKey(sysCdMapDDTO.getSCode());
                kv.setValue(sysCdMapDDTO.getSCodeNm());
                singleQuotaMap.put(sysCdMapDDTO.getSCode(), sysCdMapDDTO.getCodeAttr1()); // 单笔限额
                list.add(kv);
                if (null != sysCdMapDDTO) {
                    if (null != sysCdMapDDTO.getSCode()) {
                        if (sysCdMapDDTO.getSCode().equals(bkCd)){
                            view.addObject("money",sysCdMapDDTO.getCodeAttr1() );
                        }
                    }
                }
            }
        }
        view.addObject("singleQuotaMap",singleQuotaMap);
        view.addObject("bankList", list);
        //民族列表
        List<KeyValueVO> nationList = sysDictionaryApiService.getKvList("CST0060", "30000", "0000");
        for (KeyValueVO keyValueVO:nationList){
            String value = keyValueVO.getValue();
            if (null != value){
                value = org.springframework.util.StringUtils.trimAllWhitespace(value);
                keyValueVO.setValue(value);
            }
        }
        view.addObject("nationList", nationList);
        BaseLogUtils.newServiceLogger("兴业金租-银行信息采集  response: " + JSONObject.toJSONString(view.getModel())).info();
    }

    /**
     * 转向填写资管资料页面 越秀金租
     */
    private void viewOfPrjBscInfoEditPageForYXFL(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForYXFL", "根据prjId获取账户信息："+prjBscInfoVO.getId());
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForYXFL", "根据prjId获取账户信息" + JSON.toJSONString(prjCstAccInfoVOS));
        PrjCstAccInfoVO vo = new PrjCstAccInfoVO();
        if(CollectionUtils.isNotEmpty(prjCstAccInfoVOS)){
            vo = prjCstAccInfoVOS.get(0);
        } else {
            //没查到则拷贝历史成功的
            PrjCstAccInfoQueryCondition prjCstAccInfoQueryCondition = new PrjCstAccInfoQueryCondition();
            prjCstAccInfoQueryCondition.setCstId(prjBscInfoVO.getCstId());
            prjCstAccInfoQueryCondition.setIsDel(BaseConstant.IS_YESNO_NO);
            prjCstAccInfoQueryCondition.setChkRstCd("1");
            prjCstAccInfoQueryCondition.setInsCode(prjBscInfoVO.getInsCode());
            List<PrjCstAccInfoVO> prjCstAccInfoVOList = this.prjCstAccInfoService.searchList(prjCstAccInfoQueryCondition);
            if (CollectionUtils.isNotEmpty(prjCstAccInfoVOList)){
                vo = prjCstAccInfoVOList.get(0);
                //账户信息保存到当前项目下
                vo.setPrjId(Long.valueOf(prjBscInfoVO.getId()));
                vo.setCrtTm(new Date());
                vo.setMdfTm(new Date());
                vo.setIsDel(BaseConstant.IS_YESNO_NO);
                vo.setMdfUsrId(CurrentThreadContext.getCurrentUserId());
                Long add = this.prjCstAccInfoService.add(vo);
                vo.setId(add);
            }
        }
        if (vo != null) {
            view.addObject("cstAccInfoId", vo.getId()); // 项目客户账号信息主键
            view.addObject("bkNm", vo.getBkNm()); // 银行名称
            view.addObject("bkNo", vo.getBkNo()); // 开户行号
            view.addObject("accNo", vo.getAccNo()); // 银行账号
            view.addObject("bkCd", vo.getBkCd()); // 银行代码
            view.addObject("mp", vo.getMp()); // 银行卡绑定手机号
        }

        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForYXFL", "根据ID查询自然人客户基本信息请求==" + prjBscInfoVO.getCstId());
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForYXFL", "根据ID查询自然人客户基本信息返回==cstNpBscInfoDTO" + JSON.toJSONString(cstNpBscInfoVO));
        if(null != cstNpBscInfoVO){
            view.addObject("idAddr", cstNpBscInfoVO.getIdAddr());//户籍地详细地址
            Long yrInc = cstNpBscInfoVO.getYrInc();
            if (null != yrInc) {
                //年收入 / 12 / 100 转元 得到 月收入（元）
                String monthInc = String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(yrInc), 12D));
                BigDecimal decimal = new BigDecimal(monthInc);
                monthInc = decimal.toPlainString();
                view.addObject("monthInc", monthInc); //月收入
            }
            view.addObject("rgnPrCd2", cstNpBscInfoVO.getDomicileProvince());//户籍地省
            view.addObject("rgnCyCd2", cstNpBscInfoVO.getDomicleCity());//户籍地市
            //文化程度 CST0008
            view.addObject("eduLvlCd", cstNpBscInfoVO.getEduLvlCd());
            //居住状况 CST0030
            view.addObject("livCndCd", cstNpBscInfoVO.getLivCndCd());
        }
        //查询文化程度 字典
        List<KeyValueVO> eduLvlCdList = this.sysDictionaryApiService.getKvList(DictionaryConstant.CODE_GRP_EDU_LVL_CD, CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd());
        view.addObject("eduLvlCdList", eduLvlCdList);
        //查询居住状况 字典
        List<KeyValueVO> livCndCdList = this.sysDictionaryApiService.getKvList(DictionaryConstant.CODE_GRP_CST_LIV_CND_CD, CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd());
        view.addObject("livCndCdList", livCndCdList);

        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code
        view.addObject("certNo", prjBscInfoVO.getCertNo());//身份证号

        List<KeyValueVO> list = getBankList(PrjBscInfoConstant.PRJ_INS_CODE_YXFL);
        view.addObject("bankList",list);
        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForYXFL,进入页面=" + JSONObject.toJSONString(view)).info();
    }

    /**
     * 转向填写资管资料页面 渤海银行股份有限公司
     */
    private void viewOfPrjBscInfoEditPageForBHBANK(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");
        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForBHBANK.根据prjId获取账户信息：" + JSONObject.toJSONString(prjCstAccInfoQC)).info();
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForBHBANK.根据prjId获取账户信息" + JSON.toJSONString(prjCstAccInfoVOS)).info();
        PrjCstAccInfoVO vo = new PrjCstAccInfoVO();
        if(CollectionUtils.isNotEmpty(prjCstAccInfoVOS)){
            vo = prjCstAccInfoVOS.get(0);
            view.addObject("cstAccInfoId", vo.getId()); // 项目客户账号信息主键
            view.addObject("accNo", vo.getAccNo());
            view.addObject("mp", vo.getMp());
            view.addObject("insAccNo", vo.getInsAccNo());
        }
        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForBHBANK.根据ID查询自然人客户基本信息请求==" + prjBscInfoVO.getCstId()).info();
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForBHBANK.ID查询自然人客户基本信息返回==cstNpBscInfoDTO" + JSON.toJSONString(cstNpBscInfoVO)).info();
        String certValidEDt = "";
        String certValidSDt = "";
        if(null != cstNpBscInfoVO){
            if (null != cstNpBscInfoVO.getCertValidEDt()) certValidEDt = cstNpBscInfoVO.getCertValidEDt();
            if (null != cstNpBscInfoVO.getCertValidSDt()) certValidSDt = cstNpBscInfoVO.getCertValidSDt();
            Long yrInc = cstNpBscInfoVO.getYrInc();
            if (null != yrInc) {
                //年收入 / 12 / 100 转元 得到 月收入（元）
                String monthInc = String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(yrInc), 12D));
                BigDecimal decimal = new BigDecimal(monthInc);
                monthInc = decimal.toPlainString();
                view.addObject("monthInc", monthInc); //月收入
            }
            view.addObject("certValidSDt", certValidSDt);//身份证有效期-始
            view.addObject("certValidEDt", certValidEDt);//身份证有效期-终
            view.addObject("rgnProvCd", cstNpBscInfoVO.getPostProvince());//居住地省
            view.addObject("rgnCityCd", cstNpBscInfoVO.getPostCity());//居住地市
        }

        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code
        view.addObject("certNo", prjBscInfoVO.getCertNo());//身份证号
        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForBHBANK,进入页面=" + JSONObject.toJSONString(view)).info();
        resultVO.setData(view);
    }

    /**
     * 转向填写资管资料页面 建设银行
     */
    private void viewOfPrjBscInfoEditPageForCCBANK(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");

        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForCCBANK", "根据prjId获取账户信息："+prjBscInfoVO.getId());
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForCCBANK", "根据prjId获取账户信息" + JSON.toJSONString(prjCstAccInfoVOS));
        if(CollectionUtils.isNotEmpty(prjCstAccInfoVOS)){
            PrjCstAccInfoVO vo = prjCstAccInfoVOS.get(0);
            view.addObject("cstAccInfoId", vo.getId()); // 项目客户账号信息主键
            view.addObject("bkNm", vo.getBkNm()); // 银行名称
            view.addObject("bkNo", vo.getBkNo()); // 开户行号
            view.addObject("accNo", vo.getAccNo()); // 银行账号
            view.addObject("bkCd", vo.getBkCd()); // 银行代码
            view.addObject("mp", vo.getMp()); // 银行卡绑定手机号
        }

        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForCCBANK", "根据ID查询自然人客户基本信息请求==" + prjBscInfoVO.getCstId());
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForCCBANK", "根据ID查询自然人客户基本信息返回==cstNpBscInfoDTO" + JSON.toJSONString(cstNpBscInfoVO));
        String monthInc = "";
        if (null != cstNpBscInfoVO) {
            // 月收入
            if (null != cstNpBscInfoVO.getYrInc()) {
                monthInc = String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(cstNpBscInfoVO.getYrInc()), 12D));
            }
        }
        view.addObject("monthInc", monthInc);//月收入
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code
        view.addObject("certNo", prjBscInfoVO.getCertNo());//身份证号

        //查询支持的银行列表，目前只支持建行
        List<KeyValueVO> list = getBankList(PrjBscInfoConstant.PRJ_INS_CODE_CCBANK);
        view.addObject("bankList", list);
        if (CollectionUtils.isNotEmpty(list)) {
            view.addObject("bkCd", list.get(0).getKey());
            view.addObject("bkNm", list.get(0).getValue());
        }
        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForCCBANK,进入页面=" + JSONObject.toJSONString(view)).info();
        resultVO.setData(view);
    }

    /**
     * 转向填写资管资料页面 建设银行（对公）
     */
    private void viewOfPrjBscInfoEditPageForCCBANKTB(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");

        CstBscInfoVO cstBscInfoVO = cstBscInfoService.selectDetailById(prjBscInfoVO.getCstId());
        BaseLogUtils.newLogger("查询建行对公业务客户信息，prjId:{},cstBscInfoVO：{}" ,prjBscInfoVO.getId(), JSONObject.toJSONString(cstBscInfoVO)).info();
        view.addObject("certTypCd",cstBscInfoVO.getCertTypCd());//证件类型
        view.addObject("certTypCdNm",cstBscInfoVO.getCertTypCdNm());//证件类型名称
        view.addObject("certNo",cstBscInfoVO.getCertNo());//证件号
        view.addObject("loanCardCd",cstBscInfoVO.getCstCorpBscInfoVO().getLoanCardCd());//中征码

        CstCorpTeamVO cstCorpTeamVO = cstBscInfoVO.getCstCorpBscInfoVO().getCstCorpTeamVO();
        BaseLogUtils.newLogger("查询建行对公业务法人客户信息，prjId:{},cstCorpTeamVO：{}" ,prjBscInfoVO.getId(), JSONObject.toJSONString(cstCorpTeamVO)).info();
        view.addObject("mNm",cstCorpTeamVO.getmNm());
        view.addObject("mCertNo",cstCorpTeamVO.getCertNo());

        PrjCstAccInfoQueryCondition condition = new PrjCstAccInfoQueryCondition();
        condition.setCstId(prjBscInfoVO.getCstId());
        condition.setPrjId(prjBscInfoVO.getId());
        condition.setInsCode(prjBscInfoVO.getInsCode());
        condition.setIsDel(0);
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = prjCstAccInfoService.searchList(condition);
        BaseLogUtils.newLogger("根据prjId获取账户信息,prjId:{},prjCstAccInfoVOS:{}",prjBscInfoVO.getId(),JSON.toJSONString(prjCstAccInfoVOS)).info();
        if(CollectionUtils.isNotEmpty(prjCstAccInfoVOS)){
            PrjCstAccInfoVO vo = prjCstAccInfoVOS.get(0);
            view.addObject("cstAccInfoId", vo.getId()); // 项目客户账号信息主键
            view.addObject("bcCertTypCd",vo.getCertTypCd());//当证件为营业执照时，补充证件类型
            view.addObject("bcCertNo",vo.getCertNo());//补充证件号
            view.addObject("accTypCd",vo.getAccTypCd());
            view.addObject("accNo",vo.getAccNo());
            view.addObject("accResCd",vo.getAccResCd());
            view.addObject("accResMsg",vo.getAccResMsg());
        }

        view.addObject("fundRasInsId",prjBscInfoVO.getFundRasInsId());
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); //机构名称
        view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("prjTypCd",prjBscInfoVO.getPrjTypCd()); // 项目类型

        //建行公众号图片
        String serverPath = PropertiesCacheUtils.getProperty(UploadConstant.UPLOAD_SERVER_PATH);//服务地址
        String customerPaht = PropertiesCacheUtils.getProperty(UploadConstant.UPLOAD_COSTOMER_PATH);
        String headPic = PropertiesCacheUtils.getProperty(UploadConstant.UPLOAD_HEAD_PATH);
        //http://10.20.7.115:80/attachments/11000/ccbanktb/u287.png
        view.addObject("picture", serverPath + customerPaht + headPic);

        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForCCBANKTB,进入页面=" + JSONObject.toJSONString(view)).info();
        resultVO.setData(view);
    }

    // 三一金融行业编码我司-未知 z
    private static final String IND_CD_UNKNOWN = "z";
    /**
     * 转向填写资管资料页面 三一金融
     */
    private void viewOfPrjBscInfoEditPageForSYFL(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");
        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
        BaseLogUtils.newWebLogger("==根据prjId获取账户信息Start==prjId:" + prjBscInfoVO.getId()).info();
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        BaseLogUtils.newWebLogger("==根据prjId获取账户信息End==prjId:" + prjBscInfoVO.getId() + ",prjCstAccInfoVOS:" + JSON.toJSONString(prjCstAccInfoVOS)).info();
        PrjCstAccInfoVO vo = new PrjCstAccInfoVO();
        if(CollectionUtils.isNotEmpty(prjCstAccInfoVOS)){
            vo = prjCstAccInfoVOS.get(0);
        } else {
            PrjCstAccInfoVO prjCstAccInfo = new PrjCstAccInfoVO();
            prjCstAccInfoQC.setPrjId(null);
            prjCstAccInfoQC.setCstId(prjBscInfoVO.getCstId());
            BaseLogUtils.newWebLogger("==根据cstId获取账户信息Start==prjId:" + prjBscInfoVO.getId() + ",cstId:" + prjBscInfoVO.getCstId()).info();
            List<PrjCstAccInfoVO> prjCstAccInfoVOList = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
            BaseLogUtils.newWebLogger("==根据cstId获取账户信息End==prjId:" + prjBscInfoVO.getId() + ",prjCstAccInfoVOList:" + JSON.toJSONString(prjCstAccInfoVOList)).info();
            boolean allBindFlag = false;
            List<PrjCstAccInfoVO> fstBindList = new ArrayList<>();
            List<PrjCstAccInfoVO> secBindList = new ArrayList<>();
            for (PrjCstAccInfoVO prjCstAccInfoVO : prjCstAccInfoVOList) {
                String accResCd = prjCstAccInfoVO.getAccResCd();
                if (InsAccResEnum.SUCCESS.code.equals(accResCd)) {
                    allBindFlag = true;
                    prjCstAccInfo = prjCstAccInfoVO;
                    break;
                } else if (InsAccResEnum.SEC_BIND_SUCCESS.code.equals(accResCd)) {
                    secBindList.add(prjCstAccInfoVO);
                } else if (InsAccResEnum.FST_BIND_SUCCESS.code.equals(accResCd)) {
                    fstBindList.add(prjCstAccInfoVO);
                }
            }
            if (!allBindFlag && CollectionUtils.isNotEmpty(secBindList)) {
                prjCstAccInfo = secBindList.get(0);
            } else if (!allBindFlag && CollectionUtils.isNotEmpty(fstBindList)) {
                prjCstAccInfo = fstBindList.get(0);
            }
            BaseLogUtils.newWebLogger("==三一金融获取一绑卡账户信息==prjId:"+prjBscInfoVO.getId()+",cstId:"+prjBscInfoVO.getCstId()+",allBindFlag:"+allBindFlag+",fstBindList:"+JSON.toJSONString(fstBindList)+",secBindList:"+JSON.toJSONString(secBindList)).info();
            if (null != prjCstAccInfo && StringUtils.isNotEmpty(prjCstAccInfo.getId())) {
                // 存在已绑卡 复制一份保存
                prjCstAccInfo.setId(null);
                prjCstAccInfo.setPrjId(prjBscInfoVO.getId());
                prjCstAccInfo.setCrtTm(new Date());
                prjCstAccInfo.setCrtUsrId(CurrentThreadContext.getCurrentUserId());
                prjCstAccInfo.setMdfTm(new Date());
                prjCstAccInfo.setIsDel(BaseConstant.IS_YESNO_NO);
                prjCstAccInfo.setInsCode(prjBscInfoVO.getInsCode());
                BaseLogUtils.newWebLogger("==新增三一金融复制客户账户Start,prjId:"+prjBscInfoVO.getId()+",cstId:"+prjBscInfoVO.getCstId()+",PrjCstAccInfoVO:"+JSON.toJSONString(prjCstAccInfo)).info();
                Long add = this.prjCstAccInfoService.add(prjCstAccInfo);
                BaseLogUtils.newWebLogger("==新增三一金融复制客户账户End,prjId:"+prjBscInfoVO.getId()+",cstId:"+prjBscInfoVO.getCstId()+",add:"+JSON.toJSONString(add)).info();
                prjCstAccInfo.setId(add);
                vo = prjCstAccInfo;
            }

        }

        Long cstId = prjBscInfoVO.getCstId();
        BaseLogUtils.newWebLogger("==三一金融查询客户信息Start==cstId:" + cstId).info();
        CstBscInfoVO cstBscInfoVO = this.cstBscInfoService.selectBy(cstId, prjBscInfoVO.getBuOrgCd());
        BaseLogUtils.newWebLogger("==三一金融查询客户信息End==cstId:" + cstId + ",cstBscInfoVO:" + JSON.toJSONString(cstBscInfoVO)).info();

        String cstTypCd = cstBscInfoVO.getCstTypCd();
        String indCd = cstBscInfoVO.getIndCd();

        String certTypCd = null;
        String certNo = null;
        String certValidSDt = null;
        String certValidEDt = null;
        String domicileProvince = null;
        String domicleCity = null;
        String domicleCounty = null;
        String idAddr = null;
        String stdIndCd = null;
        // 自然人
        Integer isSmallBus = null;
        Integer isSelfEmp = null;

        // 法人-公司名称
        String shtNm = null;
        String borrowerfeature = null;
        String holdSituationCd = null;

        String mp = vo.getMp();
        String cstNm = null;

        switch (cstTypCd) {
            case CustomerConstant.CST_TYP_CD_NP:
                // 自然人
                CstNpBscInfoVO cstNpBscInfoVO = cstBscInfoVO.getCstNpBscInfoVO();
                BaseLogUtils.newWebLogger("==三一金融查询自然人客户信息Start==cstNpBscInfoVO:" + JSON.toJSONString(cstNpBscInfoVO)).info();
                if (null != cstNpBscInfoVO) {
                    certValidSDt = cstNpBscInfoVO.getCertValidSDt();
                    certValidEDt = cstNpBscInfoVO.getCertValidEDt();
                    domicileProvince = cstNpBscInfoVO.getDomicileProvince();
                    domicleCity = cstNpBscInfoVO.getDomicleCity();
                    domicleCounty = cstNpBscInfoVO.getDomicleCounty();
                    idAddr = cstNpBscInfoVO.getIdAddr();
                    stdIndCd = cstNpBscInfoVO.getStdIndCd();
                    isSmallBus = cstNpBscInfoVO.getIsSmallBus();
                    isSelfEmp = cstNpBscInfoVO.getIsSelfEmp();
                    certNo = prjBscInfoVO.getCertNo();
                    certTypCd = cstBscInfoVO.getCertTypCd();
                    cstNm = prjBscInfoVO.getCstNm();
                }
                cstNm = prjBscInfoVO.getCstNm();
                break;
            case CustomerConstant.CST_TYP_CD_CORP:
                // 法人
                CstCorpBscInfoVO cstCorpBscInfoVO = cstBscInfoVO.getCstCorpBscInfoVO();
                BaseLogUtils.newWebLogger("==三一金融查询法人客户信息Start==cstCorpBscInfoVO:" + JSON.toJSONString(cstCorpBscInfoVO)).info();
                if (null != cstCorpBscInfoVO) {
                    shtNm = cstCorpBscInfoVO.getShtNm();
                    if (StringUtils.isEmpty(shtNm)) {
                        shtNm = cstBscInfoVO.getCstNm();
                    }
                    borrowerfeature = cstCorpBscInfoVO.getBorrowerfeature();
                    holdSituationCd = cstCorpBscInfoVO.getHoldSituationCd();
                    stdIndCd = cstCorpBscInfoVO.getStdIndCd();
                }
                CstCorpTeamQueryCondition cstCorpTeamQC = new CstCorpTeamQueryCondition();
                cstCorpTeamQC.setCstId(cstId);
                cstCorpTeamQC.setIsDel(BaseConstant.IS_YESNO_NO);
                cstCorpTeamQC.setmTypCd(CustomerConstant.CST_CORP_TEAM_LOWER);
                cstCorpTeamQC.setSysCd(CurrentThreadContext.getCurrentSysCd());
                BaseLogUtils.newWebLogger("==三一金融查询法人客户信息Start==cstCorpTeamQC:" + JSON.toJSONString(cstCorpTeamQC)).info();
                List<CstCorpTeamVO> cstCorpTeamVOS = this.cstCorpTeamService.searchList(cstCorpTeamQC);
                BaseLogUtils.newWebLogger("==三一金融查询法人客户信息End==cstCorpTeamVOS:" + JSON.toJSONString(cstCorpTeamVOS)).info();
                for (CstCorpTeamVO cstCorpTeamVO : cstCorpTeamVOS) {
                    if (StringUtils.isNotBlank(cstCorpTeamVO.getCertTypCd()) && CustomerConstant.CERT_TYP_CD_0.equals(cstCorpTeamVO.getCertTypCd())) {
                        certTypCd = cstCorpTeamVO.getCertTypCd();
                        if (StringUtils.isNotBlank(cstCorpTeamVO.getCertNo())) {
                            certNo = cstCorpTeamVO.getCertNo();
                        }
                        certValidSDt = cstCorpTeamVO.getCertValidSDt();
                        certValidEDt = cstCorpTeamVO.getCertValidEDt();
                        domicileProvince = cstCorpTeamVO.getPostProvince();
                        domicleCity = cstCorpTeamVO.getPostCity();
                        domicleCounty = cstCorpTeamVO.getPostCounty();
                        idAddr = cstCorpTeamVO.getHomeAddr();
                        if (StringUtils.isBlank(mp)) {
                            mp = cstCorpTeamVO.getMp1();
                        }
                        cstNm = cstCorpTeamVO.getmNm();
                    }
                }
                // 控股情况
                List<SysDictionaryDTO> sysDictionaryDTOHoldSitu = this.sysDictionaryApiService.searchGroup(CurrentThreadContext.getFlServiceSysCd(), CurrentThreadContext.getCurrentOrgCd(), DictionaryConstant.CODE_GRP_CST_HOLD_SITU_CD);
                List<KeyValueVO> holdSituationCdList = new ArrayList();
                for (SysDictionaryDTO sysDictionaryDTO : sysDictionaryDTOHoldSitu) {
                    KeyValueVO keyValue = new KeyValueVO();
                    keyValue.setKey(sysDictionaryDTO.getCode());
                    keyValue.setValue(sysDictionaryDTO.getCodeNm());
                    holdSituationCdList.add(keyValue);
                }
                view.addObject("holdSituationCdList", holdSituationCdList);
                // 借款人特征
                List<SysDictionaryDTO> sysDictionaryDTOBorrFea = this.sysDictionaryApiService.searchGroup(CurrentThreadContext.getFlServiceSysCd(), CurrentThreadContext.getCurrentOrgCd(), DictionaryConstant.CODE_GRP_CST_BORR_FEAT_CD);
                List<KeyValueVO> borrowerfeatureList = new ArrayList();
                for (SysDictionaryDTO sysDictionaryDTO : sysDictionaryDTOBorrFea) {
                    KeyValueVO keyValue = new KeyValueVO();
                    keyValue.setKey(sysDictionaryDTO.getCode());
                    keyValue.setValue(sysDictionaryDTO.getCodeNm());
                    borrowerfeatureList.add(keyValue);
                }
                view.addObject("borrowerfeatureList", borrowerfeatureList);
                break;
        }

        //区域 省 市 县
        if (StringUtils.isNotEmpty(domicileProvince)) {
            BaseLogUtils.newWebLogger("getSyflPrjAccInfo.三一金融查询省信息Start:domicileProvince:" + domicileProvince).info();
            SysRegionVO sysRegionVO = this.sysRegionService.getRegionByRgnCd(domicileProvince);
            BaseLogUtils.newWebLogger("getSyflPrjAccInfo.三一金融查询省信息End:sysRegionVO:" + JSON.toJSONString(sysRegionVO)).info();
            if(null != sysRegionVO && StringUtils.isNotEmpty(sysRegionVO.getRgnNm())){
                view.addObject("domicileProvinceNm", sysRegionVO.getRgnNm());//省
            }
        }
        if (StringUtils.isNotEmpty(domicleCity)) {
            BaseLogUtils.newWebLogger("getSyflPrjAccInfo.三一金融查询市信息Start:domicleCity:" + domicleCity).info();
            SysRegionVO sysRegionVO = this.sysRegionService.getRegionByRgnCd(domicleCity);
            BaseLogUtils.newWebLogger("getSyflPrjAccInfo.三一金融查询市信息End:sysRegionVO:" + JSON.toJSONString(sysRegionVO)).info();
            if(null != sysRegionVO && StringUtils.isNotEmpty(sysRegionVO.getRgnNm())){
                view.addObject("domicleCityNm", sysRegionVO.getRgnNm());//市
            }
        }
        if (StringUtils.isNotEmpty(domicleCounty)) {
            BaseLogUtils.newWebLogger("getSyflPrjAccInfo.三一金融查询区县信息Start:domicleCounty:" + domicleCounty).info();
            SysRegionVO sysRegionVO = this.sysRegionService.getRegionByRgnCd(domicleCounty);
            BaseLogUtils.newWebLogger("getSyflPrjAccInfo.三一金融查询区县信息End:sysRegionVO:" + JSON.toJSONString(sysRegionVO)).info();
            if(null != sysRegionVO && StringUtils.isNotEmpty(sysRegionVO.getRgnNm())){
                view.addObject("domicleCountyNm", sysRegionVO.getRgnNm());//县
            }
        }
        view.addObject("cstTypCd", cstTypCd);// 证件类型
        view.addObject("certTypCd", certTypCd);// 证件类型
        view.addObject("certNo", certNo);//身份证号
        view.addObject("domicileProvince", domicileProvince);
        view.addObject("domicleCity", domicleCity);
        view.addObject("domicleCounty", domicleCounty);
        view.addObject("idAddr", idAddr);
        view.addObject("certValidSDt", certValidSDt);
        view.addObject("certValidEDt", certValidEDt);
        view.addObject("indCd", IND_CD_UNKNOWN.equalsIgnoreCase(indCd) ? null : indCd);
        view.addObject("stdIndCd", stdIndCd);

        // 自然人-是否小微企业
        view.addObject("isSmallBus", isSmallBus);
        view.addObject("isSelfEmp", isSelfEmp);
        // 法人-公司名称
        view.addObject("shtNm", shtNm);
        view.addObject("borrowerfeature", borrowerfeature);
        view.addObject("holdSituationCd", holdSituationCd);

        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("cstNm", cstNm); // 客户名称
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code

        view.addObject("cstAccInfoId", vo.getId()); // 项目客户账号信息主键
        view.addObject("bkNm", vo.getBkNm()); // 银行名称
        view.addObject("bkNo", vo.getBkNo()); // 开户行号
        view.addObject("accNo", vo.getAccNo()); // 银行账号
        view.addObject("bkCd", vo.getBkCd()); // 银行代码
        view.addObject("mp", mp); // 手机号
        view.addObject("chkRstCd", StringUtils.isNotBlank(vo.getChkRstCd()) ? vo.getChkRstCd() : "0");// 四要素
        view.addObject("accResCd", StringUtils.isNotBlank(vo.getAccResCd()) ? vo.getAccResCd() : InsAccResEnum.INIT_STATUS.code);// 绑卡

        // 行业列表
        List<SysDictionaryDTO> sysDictionaryDTOIndCd = this.sysDictionaryApiService.searchGroup(CurrentThreadContext.getFlServiceSysCd(), CurrentThreadContext.getCurrentOrgCd(), DictionaryConstant.CODE_GRP_IND_CD);
        List<KeyValueVO> indCdInfoList = new ArrayList();
        for (SysDictionaryDTO sysDictionaryDTO : sysDictionaryDTOIndCd) {
            if (IND_CD_UNKNOWN.equalsIgnoreCase(sysDictionaryDTO.getCode())) {
                continue;
            }
            KeyValueVO keyValue = new KeyValueVO();
            keyValue.setKey(sysDictionaryDTO.getCode());
            keyValue.setValue(sysDictionaryDTO.getCodeNm());
            indCdInfoList.add(keyValue);
        }
        view.addObject("indCdInfoList", indCdInfoList);
        // 子行业列表
        List<KeyValueVO> stdIndCdInfoList = new ArrayList();
        if (StringUtils.isNotBlank(indCd)) {
            List<SysDictionaryDTO> sysDictionaryDTOS = this.sysDictionaryApiService.searchChild(CurrentThreadContext.getFlServiceSysCd(), CurrentThreadContext.getCurrentOrgCd(), DictionaryConstant.CODE_GRP_CST_SID_IND_CD, indCd);
            for (SysDictionaryDTO sysDictionaryDTO : sysDictionaryDTOS) {
                KeyValueVO keyValue = new KeyValueVO();
                keyValue.setKey(sysDictionaryDTO.getCode());
                keyValue.setValue(sysDictionaryDTO.getCodeNm());
                stdIndCdInfoList.add(keyValue);
            }
        }
        view.addObject("stdIndCdInfoList", stdIndCdInfoList);

        SysCdMapDQueryCondition cdMapDQC = new SysCdMapDQueryCondition();
        cdMapDQC.setSysCd(WebBaseConstant.SYS_SYS_CD);
        cdMapDQC.setOrgCd(CurrentThreadContext.getCurrentOrgCd());
        cdMapDQC.setmTypCd("M1041");
        cdMapDQC.setTCode(PrjBscInfoConstant.PRJ_INS_CODE_SYFL);
        BaseLogUtils.newLogger("==查询还款银行信息Start==cdMapDQC:" + JSONObject.toJSONString(cdMapDQC)).info();
        List<SysCdMapDDTO> sysCdMapDList =  this.sysCdMapApiService.searchSysCdMapDWithTargetList(cdMapDQC);
        BaseLogUtils.newLogger("==查询还款银行信息End==sysCdMapDList:" + JSONObject.toJSONString(sysCdMapDList)).info();
        List<KeyValueVO> list =  new ArrayList<>();
        JSONObject singleQuotaMap = new JSONObject();
        if (CollectionUtils.isNotEmpty(sysCdMapDList)) {
            for(SysCdMapDDTO sysCdMapDDTO : sysCdMapDList) {
                KeyValueVO kv = new KeyValueVO();
                kv.setKey(sysCdMapDDTO.getSCode());
                kv.setValue(sysCdMapDDTO.getSCodeNm());
                list.add(kv);
                singleQuotaMap.put(sysCdMapDDTO.getSCode(), sysCdMapDDTO.getCodeAttr1()); // 单笔限额
            }
        }
        view.addObject("bankList",list);
        String singleQuota = "";
        if(StringUtils.isNotBlank(vo.getBkCd())){
            singleQuota = singleQuotaMap.getString(vo.getBkCd());
        }
        view.addObject("singleQuota", singleQuota);
        view.addObject("singleQuotaMap",singleQuotaMap);
        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForSYSL,进入页面=" + JSONObject.toJSONString(view)).info();
        resultVO.setData(view);
    }


    /**
     *  转向填写资管资料页面 淄博工商银行
     * @param request
     * @param view
     * @param prjBscInfoVO
     */
    private void viewOfPrjBscInfoEditPageForICBC(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");
        //1. 查询项目客户账户信息
        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForICBCZB.(淄博、烟台)工行Start", "根据prjId获取账户信息："+prjBscInfoVO.getId());
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForICBCZB.(淄博、烟台)工行End", "根据prjId获取账户信息" + JSON.toJSONString(prjCstAccInfoVOS));
        PrjCstAccInfoVO vo = null;
        if(CollectionUtils.isNotEmpty(prjCstAccInfoVOS)){
            vo = prjCstAccInfoVOS.get(0);

            String tolPsonlAst = ""; //个人总资产
            String othDebTbal= "";//累计负债余额
            String monRepayAmt= "";//累计负债月还（元）

            //个人总资产
            Long totalPsonlAst = vo.getTolPsonlAst();
            if(null != totalPsonlAst){
                //总资产/100 转元 / 10000 得到万元
                tolPsonlAst = String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(totalPsonlAst),10000D));
            }

            //累计负债余额（万）
            Long othDebTbalTmp = vo.getOthDebTbal();
            if(null != othDebTbalTmp){
                //累计负债余额/100 转元 / 10000 得到万元
                othDebTbal = String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(othDebTbalTmp),10000D));
            }
            //累计负债月还（元）
            Long monRepayAmtTmp = vo.getMonRepayAmt();
            if(null != monRepayAmtTmp){
                //累计负债月还（元） 100 转元 得到 月收入（元）
                monRepayAmt = String.valueOf(DecimalUtils.convertFenToYuan(monRepayAmtTmp));
            }

            //项目信息
            view.addObject("cstFnm",vo.getCstFnm());//姓
            view.addObject("cstLnm",vo.getCstLnm());//名
            view.addObject("cstPyFNm",vo.getCstPyFnm());//拼音姓
            view.addObject("cstPyLNm",vo.getCstPyLnm());//拼音名
            //资产信息
            view.addObject("cstAccInfoId", vo.getId()); // 项目客户账号信息主键
            view.addObject("bkCd", vo.getBkCd()); // 银行代码
            view.addObject("bkNm", vo.getBkNm()); // 银行名称
            view.addObject("accNo", vo.getAccNo()); // 银行账号
            view.addObject("mp", vo.getMp()); // 银行预留手机号 （银行卡绑定手机号）
            view.addObject("tolPsonlAst",tolPsonlAst);//个人总资产(万)
            view.addObject("othDebTbal",othDebTbal);//累计负债余额（万）
            view.addObject("monRepayAmt",monRepayAmt);//累计负债月还（元）
            view.addObject("rsidOcpyDt",DateUtils.formatDateToString(vo.getRsidOcpyDt(), DateUtils.YYYY_MM_DD));//住宅入住日期

        }
        //2. 查询自然人信息表中的地址信息 及月收入
        BaseLogUtils.newLogger("getCstNpBscInfo.(淄博、烟台)工行根据ID查询自然人客户基本信息请求==" + prjBscInfoVO.getCstId()).info();
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        BaseLogUtils.info(logger, "getCstNpBscInfo.(淄博、烟台)工行", "根据ID查询自然人客户基本信息返回==cstNpBscInfoDTO" + JSON.toJSONString(cstNpBscInfoVO));

        //查询客户证件信息
        CstBscInfoVO cstBscInfoVO = this.cstBscInfoService.selectById(prjBscInfoVO.getCstId());
        if(null != cstBscInfoVO ){
            view.addObject("certNo", cstBscInfoVO.getCertNo()); // 证件号码
            view.addObject("certTypCd", cstBscInfoVO.getCertTypCd()); //证件类型
        }
        //取客户信息月收入 月收入的计算放到发起项目评审流程中计算
        String monthInc = "";
        if (null != cstNpBscInfoVO) {
            // 月收入
            if (null != cstNpBscInfoVO.getYrInc()) {
                monthInc = String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(cstNpBscInfoVO.getYrInc()), 12D));
            }
        }
        //区域 省 市 县
        String postProvince = cstNpBscInfoVO.getPostProvince();
        String postProvinceNm = "";
        String postCity = cstNpBscInfoVO.getPostCity();
        String postCityNm = "";
        String postCounty = cstNpBscInfoVO.getPostCounty();
        String postCountyNm = "";
        //区域 省 市 县
        if (StringUtils.isNotEmpty(postProvince)) {
            BaseLogUtils.newWebLogger("getCstNpBscInfo.(淄博、烟台)工行查询省信息Start:postProvince:" + postProvince).info();
            SysRegionVO sysRegionVO = this.sysRegionService.getRegionByRgnCd(postProvince);
            BaseLogUtils.newWebLogger("getCstNpBscInfo.(淄博、烟台)工行查询省信息End:sysRegionVO:" + JSON.toJSONString(sysRegionVO)).info();
            if(null != sysRegionVO && StringUtils.isNotEmpty(sysRegionVO.getRgnNm())){
                postProvinceNm = sysRegionVO.getRgnNm();

            }
        }
        if (StringUtils.isNotEmpty(postCity)) {
            BaseLogUtils.newWebLogger("getCstNpBscInfo.(淄博、烟台)工行查询市信息Start:domicleCity:" + postCity).info();
            SysRegionVO sysRegionVO = this.sysRegionService.getRegionByRgnCd(postCity);
            BaseLogUtils.newWebLogger("getCstNpBscInfo.(淄博、烟台)工行查询市信息End:sysRegionVO:" + JSON.toJSONString(sysRegionVO)).info();
            if(null != sysRegionVO && StringUtils.isNotEmpty(sysRegionVO.getRgnNm())){
                postCityNm = sysRegionVO.getRgnNm();

            }
        }
        if (StringUtils.isNotEmpty(postCounty)) {
            BaseLogUtils.newWebLogger("getCstNpBscInfo.(淄博、烟台)工行查询区县信息Start:domicleCounty:" + postCounty).info();
            SysRegionVO sysRegionVO = this.sysRegionService.getRegionByRgnCd(postCounty);
            BaseLogUtils.newWebLogger("getCstNpBscInfo.(淄博、烟台)工行查询区县信息End:sysRegionVO:" + JSON.toJSONString(sysRegionVO)).info();
            if(null != sysRegionVO && StringUtils.isNotEmpty(sysRegionVO.getRgnNm())){
                postCountyNm = sysRegionVO.getRgnNm();
            }
        }

        //项目信息
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code
        //身份证信息
        view.addObject("issuingOrg",cstNpBscInfoVO.getIssuingOrg());//身份证签发机关
        //view.addObject("idAddr",cstNpBscInfoVO.getPostAddr());//身份证地址
        view.addObject("postAddr",cstNpBscInfoVO.getPostAddr());//身份证地址 (同客户信息通讯地址)
        view.addObject("postProvince",postProvince);//现居住地址-省（通讯地址）
        view.addObject("postProvinceNm",postProvinceNm);//省
        view.addObject("postCity",postCity);//现居住地址-市 （通讯地址）
        view.addObject("postCityNm", postCityNm);//市
        view.addObject("postCounty",postCounty);//现居住地址-县 （通讯地址）
        view.addObject("postCountyNm", postCountyNm);//县
        //资产信息
        view.addObject("monthInc", monthInc); // 个人月收入(元)
        resultVO.setData(view);
    }
    /**
     * @Author yangzhongkun
     * @params [request, view, prjBscInfoVO,cstBscInfoVO]
     * @Description //TODO 转向填写资管资料页面 三井住友
     * @Date 2020/5/21 11:19
     * @return void
     **/
    private void viewOfPrjBscInfoEditPageForSMBC(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {

        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");

        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForSMBC.资管资料采集三井住友,查询客户信息Start:cstId={}",prjBscInfoVO.getCstId());
        CstBscInfoVO cstBscInfoVO = this.cstBscInfoService.selectById(prjBscInfoVO.getCstId());
        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForSMBC.资管资料采集三井住友,查询客户信息Start:cstBscInfoVO={}",JSON.toJSONString(cstBscInfoVO));

        if(null == cstBscInfoVO ) {

            throw new BaseException("系统错误，请维护客户基础信息！");

        }

        //获取自然人信息
        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForSMBC.资管资料采集三井住友,查询自然人信息Start:cstId = {}" , prjBscInfoVO.getCstId()).info();
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForSMBC.资管资料采集三井住友,查询自然人信息End:cstNpBscInfoVO = {}" , JSONObject.toJSONString(cstNpBscInfoVO)).info();

        if(null != cstNpBscInfoVO) {
            //最高学历
            view.addObject("highDgCd", cstNpBscInfoVO.getHighDgCd());
        }

        //查询学历 字典
        List<KeyValueVO> highDgCdList = this.sysDictionaryApiService.getKvList(DictionaryConstant.CODE_GRP_CST_HIGH_DG_CD, CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd());

        view.addObject("highDgCdList", highDgCdList);

        // 客户ID
        view.addObject("cstId", prjBscInfoVO.getCstId());
        // 项目ID
        view.addObject("prjId", prjBscInfoVO.getId());
        //机构名称
        view.addObject("fundRasInsNm",prjBscInfoVO.getFundRasInsNm());
        //机构code
        view.addObject("insCode",prjBscInfoVO.getInsCode());
        //客户名称
        view.addObject("cstNm", cstBscInfoVO.getCstNm());
        //身份证号
        view.addObject("certNo", cstBscInfoVO.getCertNo());


        resultVO.setData(view);

    }

    /**
     * @Author yangzhongkun
     * @params [request, view, prjBscInfoVO]
     * @Description 转向填写资管资料页面 江西裕民银行
     * @Date 2020/7/6 11:28
     * @return void
     **/
    private void viewOfPrjBscInfoEditPageForJXYMBANK(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");

        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
        BaseLogUtils.newLogger("江西裕民银行根据prjId获取账户信息Start:prjId={}",prjBscInfoVO.getId()).info();
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        BaseLogUtils.newLogger("江西裕民银行根据prjId获取账户信息End:prjId={},prjCstAccInfoVOS={}",prjBscInfoVO.getId(),JSONObject.toJSONString(prjCstAccInfoVOS)).info();
        //查询开户行列表 并将各开户行限额存入map集合中
        JSONObject singleQuotaMap = new JSONObject();
        List<KeyValueVO> list = getBankList(PrjBscInfoConstant.PRJ_INS_CODE_JXYMBANK,singleQuotaMap);
        view.addObject("bankList",list);
        view.addObject("singleQuotaMap",singleQuotaMap);
        view.addObject("accResCd","未开户");// 开户状态
        if(CollectionUtils.isNotEmpty(prjCstAccInfoVOS)){
            PrjCstAccInfoVO vo  = prjCstAccInfoVOS.get(0);
            view.addObject("cstAccInfoId", vo.getId()); // 项目客户账号信息主键
            view.addObject("accNo", vo.getAccNo()); // 银行账号
            view.addObject("mp", vo.getMp()); // 银行预留手机号
            view.addObject("bkCd", vo.getBkCd()); // 银行代码
            if (InsAccResEnum.SUCCESS.getCode().equals(vo.getAccResCd())) {
                view.addObject("accResCd", "已开户");// 开户状态
            }

            //获取开户行限额
            String singleQuota = "";
            if(StringUtils.isNotBlank(vo.getBkCd())){
                singleQuota = singleQuotaMap.getString(vo.getBkCd());
            }
            view.addObject("singleQuota", singleQuota);
        }


        BaseLogUtils.newLogger("江西裕民银行根据cstId获取自然人信息Start:cstId={}" , prjBscInfoVO.getCstId()).info();
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        BaseLogUtils.newLogger("江西裕民银行根据cstId获取自然人信息End:cstId={},cstNpBscInfoVO={}" ,prjBscInfoVO.getCstId(), JSON.toJSONString(cstNpBscInfoVO)).info();

        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("certNo", prjBscInfoVO.getCertNo());//身份证号
        view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code
        view.addObject("fundRasInsId", prjBscInfoVO.getFundRasInsId());//机构id
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        if(null != prjBscInfoVO.getCstId()) {
            if(null != cstNpBscInfoVO) {
                String certValidSDt = cstNpBscInfoVO.getCertValidSDt(); // 证件有效起始日期
                String certValidEDt = cstNpBscInfoVO.getCertValidEDt(); // 证件有效终止日期
                view.addObject("certValidSDt", certValidSDt == null ? "" : certValidSDt);
                view.addObject("certValidEDt", certValidEDt == null ? "" : certValidEDt);
            }
        }

        BaseLogUtils.newLogger("江西裕民银行资管信息采集进入页面:view={}" , JSONObject.toJSONString(view)).info();
        resultVO.setData(view);
    }

    /**
     * @Author yangzhongkun
     * @params [request, view, prjBscInfoVO]
     * @Description 转向填写资管资料页面 天银租赁
     * @Date 2020/7/13 10:34
     * @return void
     **/
    private void viewOfPrjBscInfoEditPageForTYFL(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");


        BaseLogUtils.newLogger("天银租赁资管信息采集根据cstId获取自然人信息Start:cstId={}" , prjBscInfoVO.getCstId()).info();
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        BaseLogUtils.newLogger("天银租赁资管信息采集根据cstId获取自然人信息End:cstId={},cstNpBscInfoVO={}" ,prjBscInfoVO.getCstId(), JSON.toJSONString(cstNpBscInfoVO));

        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("certNo", prjBscInfoVO.getCertNo());//身份证号
        if(null != prjBscInfoVO.getCstId()) {
            if(null != cstNpBscInfoVO) {
                String postAddr = cstNpBscInfoVO.getPostAddr();
                String postProvince = cstNpBscInfoVO.getPostProvince();
                String postCity = cstNpBscInfoVO.getPostCity();//通讯地址-市
                //区域 省 市
                String postProvinceNm = this.getCommonRegionDictNm(postProvince);
                String postCityNm = this.getCommonRegionDictNm(postCity);
                view.addObject("postAddr", postAddr);//通讯地址
                view.addObject("postProvince", postProvince);//通讯地址-省
                view.addObject("postProvinceNm", postProvinceNm);//通讯地址-省名称
                view.addObject("postCity", postCity);//通讯地址-市
                view.addObject("postCityNm", postCityNm);//通讯地址-市名称
            }
        }
        BaseLogUtils.newLogger("天银租赁资管信息采集进入页面:view={}" , JSONObject.toJSONString(view)).info();
        resultVO.setData(view);
    }

    /**
     * @Author yangzhongkun
     * @params [code]
     * @Description 公共--根据regionCode查询区域名称
     * @Date 2020/7/13 11:31
     * @return java.lang.String
     **/
    private String getCommonRegionDictNm(String regionCode) {
        if (StringUtils.isEmpty(regionCode)) {
            return "";
        }
        String regionName = "";
        BaseLogUtils.newLogger("资管信息采集根据区域regionCode查询区域名称信息Start:regionCode={}" , regionCode).info();
        SysRegionVO sysRegionVO = this.sysRegionService.getRegionByRgnCd(regionCode);
        BaseLogUtils.newLogger("资管信息采集根据区域regionCode查询区域名称信息End:regionCode={},sysRegionVO={}" , regionCode,JSON.toJSONString(sysRegionVO)).info();
        if(null != sysRegionVO && StringUtils.isNotEmpty(sysRegionVO.getRgnNm())){
            regionName = sysRegionVO.getRgnNm();
        }
        return regionName;
    }


    /**
     * 公共--查询支持银行列表
     */
    private List<KeyValueVO> getBankList(String insCode) {
        //查询支持的银行列表
        SysCdMapDQueryCondition cdMapDQC = new SysCdMapDQueryCondition();
        cdMapDQC.setSysCd(WebBaseConstant.SYS_SYS_CD);
        cdMapDQC.setOrgCd(CurrentThreadContext.getCurrentOrgCd());
        cdMapDQC.setmTypCd("M1041");
        cdMapDQC.setTCode(insCode);
        List<SysCdMapDDTO> sysCdMapDList =  this.sysCdMapApiService.searchSysCdMapDWithTargetList(cdMapDQC);
        List<KeyValueVO> list =  new ArrayList<>();
        if (CollectionUtils.isNotEmpty(sysCdMapDList)) {
            for(SysCdMapDDTO sysCdMapDDTO : sysCdMapDList) {
                KeyValueVO kv = new KeyValueVO();
                kv.setKey(sysCdMapDDTO.getSCode());
                kv.setValue(sysCdMapDDTO.getSCodeNm());
                list.add(kv);
            }
        }
        return list;
    }

    /**
     * @Author yangzhongkun
     * @params [insCode, singleQuotaMap]
     * @Description 公共--查询支持银行列表 重载方法 查询开户行 并设置开户行限额
     * @Date 2020/7/29 16:20
     * @return java.util.List<cmm.mid.core.framework.page.KeyValueVO>
     **/
    private  List<KeyValueVO> getBankList(String insCode,JSONObject singleQuotaMap) {
        //查询支持的银行列表
        SysCdMapDQueryCondition cdMapDQC = new SysCdMapDQueryCondition();
        cdMapDQC.setSysCd(WebBaseConstant.SYS_SYS_CD);
        cdMapDQC.setOrgCd(CurrentThreadContext.getCurrentOrgCd());
        cdMapDQC.setmTypCd("M1041");
        cdMapDQC.setTCode(insCode);
        List<SysCdMapDDTO> sysCdMapDList =  this.sysCdMapApiService.searchSysCdMapDWithTargetList(cdMapDQC);
        List<KeyValueVO> list =  new ArrayList<>();
        if (CollectionUtils.isNotEmpty(sysCdMapDList)) {
            for(SysCdMapDDTO sysCdMapDDTO : sysCdMapDList) {
                KeyValueVO kv = new KeyValueVO();
                kv.setKey(sysCdMapDDTO.getSCode());
                kv.setValue(sysCdMapDDTO.getSCodeNm());
                list.add(kv);
                singleQuotaMap.put(sysCdMapDDTO.getSCode(), sysCdMapDDTO.getCodeAttr1()); // 单笔限额
            }
        }
        return list;
    }

    /**
     * 转向填写资管资料页面 安鹏金租
     */
    private void viewOfPrjBscInfoEditPageForAPFL(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");

        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForAPFL", "根据prjId获取账户信息："+prjBscInfoVO.getId());
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        BaseLogUtils.info(logger, "viewOfPrjBscInfoEditPageForAPFL", "根据prjId获取账户信息" + JSON.toJSONString(prjCstAccInfoVOS));
        if(CollectionUtils.isNotEmpty(prjCstAccInfoVOS)){
            PrjCstAccInfoVO vo = prjCstAccInfoVOS.get(0);
            view.addObject("cstAccInfoId", vo.getId()); // 项目客户账号信息主键
            view.addObject("bkNm", vo.getBkNm()); // 银行名称
            view.addObject("bkNo", vo.getBkNo()); // 开户行号
            view.addObject("accNo", vo.getAccNo()); // 银行账号
            view.addObject("bkCd", vo.getBkCd()); // 银行代码
            view.addObject("mp", vo.getMp()); // 银行卡绑定手机号
        }

        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForAPFL.根据ID查询自然人客户基本信息请求==" + prjBscInfoVO.getCstId()).info();
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForAPFL.根据ID查询自然人客户基本信息返回==cstNpBscInfoDTO" + JSON.toJSONString(cstNpBscInfoVO)).info();
        String monthInc = "";
        if (null != cstNpBscInfoVO) {
            // 月收入
            if (null != cstNpBscInfoVO.getYrInc()) {
                monthInc = String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(cstNpBscInfoVO.getYrInc()), 12D));
            }
            view.addObject("postProvince",cstNpBscInfoVO.getPostProvince());
            view.addObject("postCity",cstNpBscInfoVO.getPostCity());
            view.addObject("postAddr",cstNpBscInfoVO.getPostAddr());
        }
        view.addObject("monthInc", monthInc);//月收入
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code
        view.addObject("certNo", prjBscInfoVO.getCertNo());//身份证号

        List<KeyValueVO> list = getBankList(PrjBscInfoConstant.PRJ_INS_CODE_APFL);
        view.addObject("bankList", list);
        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForAPFL,进入页面=" + JSONObject.toJSONString(view)).info();
        resultVO.setData(view);
    }

    private void viewOfPrjBscInfoEditPageForTIANJINBANK(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        Long prjId = prjBscInfoVO.getId();
        //根据id查询项目信息
        BaseLogUtils.newLogger("天津银行信息采集查询,查询项目信息Start,prjId:{}", prjId).info();

        BaseLogUtils.newLogger("天津银行信息采集查询,获取自然人信息Start,cstId:{}", prjBscInfoVO.getCstId()).info();
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        BaseLogUtils.newLogger("天津银行信息采集查询,获取自然人信息End,cstId:{},cstNpBscInfoVO:{}", prjBscInfoVO.getCstId(), JSON.toJSONString(cstNpBscInfoVO)).info();

        view.addObject("prjId", prjId);
        // 机构id
        view.addObject("fundRasInsId", prjBscInfoVO.getFundRasInsId());
        // 机构名称
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm());
        // 机构code
        view.addObject("insCode", prjBscInfoVO.getInsCode());
        // 客户ID
        view.addObject("cstId", prjBscInfoVO.getCstId());
        // 客户名称
        view.addObject("cstNm", prjBscInfoVO.getCstNm());
        // 客户证件号
        view.addObject("certNo", prjBscInfoVO.getCertNo());

        // 居住状况字典列表 CST0030
        List<KeyValueVO> livCndCdList = this.sysDictionaryApiService.getKvList(DictionaryConstant.CODE_GRP_CST_LIV_CND_CD, CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd());
        BaseLogUtils.newLogger("天津银行信息采集查询,居住状况字典列表,livCndCdList:{}", JSONObject.toJSONString(livCndCdList)).info();
        view.addObject("livCndCdList", livCndCdList);

        if (null != cstNpBscInfoVO) {
            // 户籍所在地省-编码
            // 户籍所在地省-名称
            String domicileProvince = cstNpBscInfoVO.getDomicileProvince();
            view.addObject("domicileProvince", domicileProvince);
            view.addObject("domicileProvinceNm", null);
            if (StringUtils.isNotBlank(domicileProvince)) {
                view.addObject("domicileProvinceNm", this.getCommonRegionDictNm(domicileProvince));
            }
            // 户籍所在地市-编码
            // 户籍所在地市-名称
            String domicileCity = cstNpBscInfoVO.getDomicleCity();
            view.addObject("domicileCity", domicileCity);
            view.addObject("domicileCityNm", null);
            if (StringUtils.isNotBlank(domicileCity)) {
                view.addObject("domicileCityNm", this.getCommonRegionDictNm(domicileCity));
            }
            // 户籍所在地区县-编码
            // 户籍所在地区县-名称
            String domicileCounty = cstNpBscInfoVO.getDomicleCounty();
            view.addObject("domicileCounty", domicileCounty);
            view.addObject("domicileCountyNm", null);
            if (StringUtils.isNotBlank(domicileCounty)) {
                view.addObject("domicileCountyNm", this.getCommonRegionDictNm(domicileCounty));
            }
            // 居住省-编码
            // 居住省-名称
            String postProvince = cstNpBscInfoVO.getPostProvince();
            view.addObject("postProvince", postProvince);
            view.addObject("postProvinceNm", null);
            if (StringUtils.isNotBlank(postProvince)) {
                view.addObject("postProvinceNm", this.getCommonRegionDictNm(postProvince));
            }
            // 居住市-编码
            // 居住省-名称
            String postCity = cstNpBscInfoVO.getPostCity();
            view.addObject("postCity", postCity);
            view.addObject("postCityNm", null);
            if (StringUtils.isNotBlank(postCity)) {
                view.addObject("postCityNm", this.getCommonRegionDictNm(postCity));
            }
            // 居住状况-编码
            String livCndCd = cstNpBscInfoVO.getLivCndCd();
            view.addObject("livCndCd", livCndCd);
            // 居住状况-名称
            String livCndCdNm = cstNpBscInfoVO.getLivCndCdNm();
            view.addObject("livCndCdNm", livCndCdNm);
            if (StringUtils.isBlank(livCndCdNm) && StringUtils.isNotBlank(livCndCd) && CollectionUtils.isNotEmpty(livCndCdList)) {
                for (KeyValueVO keyValueVO : livCndCdList) {
                    if (livCndCd.equals(keyValueVO.getKey())) {
                        view.addObject("livCndCdNm", keyValueVO.getValue());
                        break;
                    }
                }
            }
        }
        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        BaseLogUtils.newLogger("天津银行保存信息,获取账户信息Start,prjId:{}", prjId).info();
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        BaseLogUtils.newLogger("天津银行保存信息,获取账户信息End,prjId:{},prjCstAccInfoVOS:{}", prjId, JSONObject.toJSONString(prjCstAccInfoVOS)).info();
        if (CollectionUtils.isEmpty(prjCstAccInfoVOS)) {
            PrjCstAccInfoVO prjCstAccInfoVO = new PrjCstAccInfoVO();
            prjCstAccInfoVO.setPrjId(Long.valueOf(prjId));
            prjCstAccInfoVO.setInsCode(prjBscInfoVO.getInsCode());
            prjCstAccInfoVO.setCstId(prjBscInfoVO.getCstId());
            prjCstAccInfoVO.setCstNm(prjBscInfoVO.getCstNm());
            prjCstAccInfoVO.setCertNo(prjBscInfoVO.getCertNo());
            prjCstAccInfoVO.setIsValid(BaseConstant.IS_YESNO_YES);
            prjCstAccInfoVO.setIsDel(BaseConstant.IS_YESNO_NO);
            prjCstAccInfoVO.setCrtUsrId(CurrentThreadContext.getCurrentUserId());
            prjCstAccInfoVO.setCrtTm(new Date());
            BaseLogUtils.newLogger("天津银行保存信息,保存账户信息Start,prjId:{}", prjId).info();
            Long addId = this.prjCstAccInfoService.add(prjCstAccInfoVO);
            BaseLogUtils.newLogger("天津银行保存信息,保存账户信息End,prjId:{},addId:{}", prjId, addId).info();
        }
        BaseLogUtils.newLogger("天津银行信息采集查询End,prjId:{}, view:{}", prjId, JSONObject.toJSONString(view)).info();
    }

    /**
     * 转向填写资管资料页面 青岛工行
     */
    private void viewOfPrjBscInfoEditPageForICBCQD(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");

        cn.fl.preloan.condition.PrjCstAccInfoQueryCondition prjCstAccInfoQC = new cn.fl.preloan.condition.PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForICBCQD.根据prjId获取账户信息Start.prjId:{},qc:{}", prjBscInfoVO.getId(), JSON.toJSONString(prjCstAccInfoQC)).info();
        ResponseData<List<PrjCstAccInfoDTO>> resp = this.projectCstAccInfoApiService.searchList(prjCstAccInfoQC);
        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForICBCQD.根据prjId获取账户信息End.prjId:{},list:{}", prjBscInfoVO.getId(), JSON.toJSONString(resp)).info();
        if (resp != null && ResponseData.SUCCESS_CODE.equals(resp.getCode())) {
            List<PrjCstAccInfoDTO> data = resp.getData();
            PrjCstAccInfoDTO dto = null;
            PrjCstAccInfoDTO accInfoDTO = null;
            if (CollectionUtils.isNotEmpty(data)) {
                accInfoDTO = data.get(0);
            }
            //若是含授信通过时间的，直接取值，否则查询是否有授信通过记录，若有，取通过记录，否则，取当前记录
            if (accInfoDTO != null && accInfoDTO.getCreditExpireDt() != null) {
                dto = accInfoDTO;
            }
            if (dto == null) {
                //判断客户是否存在同一资方（青岛工行）已授信审批通过的项目，若有，则需要将之前项目的信息采集页字段抓取过来自动填充，不允许修改
                cn.fl.preloan.condition.PrjCstAccInfoQueryCondition prjCstAccInfoQuery = new cn.fl.preloan.condition.PrjCstAccInfoQueryCondition();
                prjCstAccInfoQuery.setCstId(prjBscInfoVO.getCstId());
                prjCstAccInfoQuery.setInsCode(PrjBscInfoConstant.PRJ_INS_CODE_ICBCQD);
                prjCstAccInfoQuery.setIsDel(BaseConstant.IS_YESNO_NO);
                BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForICBCQD.根据客户id获取授信通过的项目Start.prjId:{},qc:{}", prjBscInfoVO.getId(), JSON.toJSONString(prjCstAccInfoQuery)).info();
                ResponseData<List<PrjCstAccInfoDTO>> responseData = this.projectCstAccInfoApiService.searchList(prjCstAccInfoQuery);
                BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForICBCQD.根据客户id获取授信通过的项目End.prjId:{},qc:{}", prjBscInfoVO.getId(), JSON.toJSONString(prjCstAccInfoQuery)).info();
                PrjCstAccInfoDTO prjCstAccInfo = null;
                if (responseData != null && ResponseData.SUCCESS_CODE.equals(responseData.getCode()) && responseData.getData() != null) {
                    List<PrjCstAccInfoDTO> cstAccInfoDTOS = responseData.getData();
                    if (CollectionUtils.isNotEmpty(cstAccInfoDTOS)) {
                        for (PrjCstAccInfoDTO prjCstAccInfoDTO : cstAccInfoDTOS) {
                            Date creditExpireDt = prjCstAccInfoDTO.getCreditExpireDt();
                            if (creditExpireDt != null) {
                                prjCstAccInfo = prjCstAccInfoDTO;
                                break;
                            }
                        }
                    }
                }
                if (prjCstAccInfo != null) {
                    prjCstAccInfo.setPrjId(prjBscInfoVO.getId());
                    prjCstAccInfo.setCrtTm(new Date());
                    prjCstAccInfo.setMdfTm(new Date());
                    prjCstAccInfo.setIsDel(BaseConstant.IS_YESNO_NO);
                    prjCstAccInfo.setInsCode(prjBscInfoVO.getInsCode());
                    // 复制绑卡成功信息
                    if (accInfoDTO != null) {
                        prjCstAccInfo.setId(accInfoDTO.getId());
                        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForICBCQD.复制客户账户开始.prjId:{},prjCstAccInfo:{}", prjBscInfoVO.getId(), JSON.toJSONString(prjCstAccInfo)).info();
                        ResponseData<Boolean> modifyResp = this.projectCstAccInfoApiService.modifyById(prjCstAccInfo);
                        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForICBCQD.复制客户账户结束.prjId:{},addResp:{}", prjBscInfoVO.getId(), JSON.toJSONString(modifyResp)).info();
                        if (modifyResp == null || !ResponseData.SUCCESS_CODE.equals(modifyResp.getCode())) {
                            BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForICBCQD.复制客户账户失败.prjId:{},addResp:{}", prjBscInfoVO.getId(), JSON.toJSONString(modifyResp)).error(LogExceptionEnum.COMMON_CODE_0002);
                        }
                    } else {
                        prjCstAccInfo.setId(null);
                        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForICBCQD.复制客户账户开始.prjId:{},prjCstAccInfo:{}", prjBscInfoVO.getId(), JSON.toJSONString(prjCstAccInfo)).info();
                        ResponseData<Long> addResp = this.projectCstAccInfoApiService.add(prjCstAccInfo);
                        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForICBCQD.复制客户账户结束.prjId:{},addResp:{}", prjBscInfoVO.getId(), JSON.toJSONString(addResp)).info();
                        if (addResp != null && ResponseData.SUCCESS_CODE.equals(addResp.getCode()) && addResp.getData() != null) {
                            prjCstAccInfo.setId(addResp.getData());
                        } else {
                            BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForICBCQD.复制客户账户失败.prjId:{},addResp:{}", prjBscInfoVO.getId(), JSON.toJSONString(addResp)).error(LogExceptionEnum.COMMON_CODE_0002);
                        }
                    }
                    dto = prjCstAccInfo;
                }
            }
            //当前项目没有授信通过日期，也未查到当前客户有已授信通过记录
            if (dto == null && accInfoDTO != null) {
                dto = accInfoDTO;
            }
            String creditPass = "0";
            if (dto != null) {
                view.addObject("cstAccInfoId", dto.getId()); // 项目客户账号信息主键
                view.addObject("bkNm", dto.getBkNm()); // 银行名称
                view.addObject("bkNo", dto.getBkNo()); // 开户行号
                view.addObject("accNo", dto.getAccNo()); // 银行账号
                view.addObject("bkCd", dto.getBkCd()); // 银行代码
                view.addObject("mp", dto.getMp()); // 银行卡绑定手机号
                if (dto.getCreditExpireDt() != null) {
                    creditPass = "1";
                }
            }
            //是否存在授信申请通过的标识
            view.addObject("creditPass", creditPass);
        }

        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForICBCQD.根据ID查询自然人客户基本信息请求Start.cstId:{}", prjBscInfoVO.getCstId()).info();
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForICBCQD.根据ID查询自然人客户基本信息请求End.cstId:{},vo:{}", prjBscInfoVO.getCstId(), JSON.toJSONString(cstNpBscInfoVO)).info();

        if (null != cstNpBscInfoVO) {
            view.addObject("postProvince", cstNpBscInfoVO.getPostProvince());//通讯地址省
            view.addObject("postCity", cstNpBscInfoVO.getPostCity());//通讯地址市
            view.addObject("postCounty", cstNpBscInfoVO.getPostCounty());//通讯地址县
            view.addObject("postAddr", cstNpBscInfoVO.getPostAddr());//通讯地址
        }
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code
        view.addObject("certNo", prjBscInfoVO.getCertNo());//身份证号

        //查询支持的银行列表，目前只支持
        List<KeyValueVO> list = getBankList(PrjBscInfoConstant.PRJ_INS_CODE_ICBCQD);
        view.addObject("bankList", list);
        if (CollectionUtils.isNotEmpty(list)) {
            view.addObject("bkCd", list.get(0).getKey());
            view.addObject("bkNm", list.get(0).getValue());
        }
        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForICBCQD.进入页面.prjId:{},view:{}", prjBscInfoVO.getId(), JSON.toJSONString(view)).info();
        resultVO.setData(view);
    }

    /**
     * 亿联银行
     * @param request
     * @param view
     * @param prjBscInfoVO
     */
    private void viewOfPrjBscInfoEditPageForYLBANK(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        Long prjId = prjBscInfoVO.getId();
        //根据id查询项目信息
        BaseLogUtils.newLogger("亿联银行信息采集查询,查询项目信息Start,prjId:{}", prjId).info();

        BaseLogUtils.newLogger("亿联银行信息采集查询,获取客户信息Start,cstId:{}", prjBscInfoVO.getCstId()).info();
//        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        CstBscInfoVO cstBscInfoVO = this.cstBscInfoService.selectBy(prjBscInfoVO.getCstId(), prjBscInfoVO.getBuOrgCd());
        BaseLogUtils.newLogger("亿联银行信息采集查询,获取客户信息End,cstId:{},cstBscInfoVO:{}", prjBscInfoVO.getCstId(), JSON.toJSONString(cstBscInfoVO)).info();



        view.addObject("prjId", prjId);
        // 机构id
        view.addObject("fundRasInsId", prjBscInfoVO.getFundRasInsId());
        // 机构名称
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm());
        // 机构code
        view.addObject("insCode", prjBscInfoVO.getInsCode());
        // 客户ID
        view.addObject("cstId", prjBscInfoVO.getCstId());
        // 客户名称
        view.addObject("cstNm", prjBscInfoVO.getCstNm());
        // 客户证件号
        view.addObject("certNo", prjBscInfoVO.getCertNo());

        // 民族
        List<KeyValueVO> nationList = this.sysDictionaryApiService.getKvList(DictionaryConstant.CODE_GRP_CST_NATION_CD, CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd());
        BaseLogUtils.newLogger("亿联银行信息采集查询,居住状况字典列表,nationList:{}", JSONObject.toJSONString(nationList)).info();
        view.addObject("nationList", nationList);
        // 学历
        List<KeyValueVO> highDgCdList = this.sysDictionaryApiService.getKvList(DictionaryConstant.CODE_GRP_CST_HIGH_DG_CD, CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd());
        BaseLogUtils.newLogger("亿联银行信息采集查询,居住状况字典列表,highDgCdList:{}", JSONObject.toJSONString(highDgCdList)).info();
        view.addObject("highDgCdList", highDgCdList);
        // 行业
        List<KeyValueVO> indCdList = this.sysDictionaryApiService.getKvList(DictionaryConstant.CODE_GRP_IND_CD, CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd());
        BaseLogUtils.newLogger("亿联银行信息采集查询,居住状况字典列表,indCdList:{}", JSONObject.toJSONString(indCdList)).info();
        view.addObject("indCdList", indCdList);

        if (null != cstBscInfoVO) {
            view.addObject("indCd", cstBscInfoVO.getIndCd());

            CstNpBscInfoVO cstNpBscInfoVO = cstBscInfoVO.getCstNpBscInfoVO();
            if (null != cstNpBscInfoVO) {
                view.addObject("prjId", prjId);
                // 机构id
                view.addObject("fundRasInsId", prjBscInfoVO.getFundRasInsId());
                // 机构名称
                view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm());
                // 机构code
                view.addObject("insCode", prjBscInfoVO.getInsCode());
                // 客户ID
                view.addObject("cstId", prjBscInfoVO.getCstId());
                // 客户名称
                view.addObject("cstNm", prjBscInfoVO.getCstNm());
                // 客户证件号
                view.addObject("certNo", prjBscInfoVO.getCertNo());
                // 身份证所在地省-编码
                // 身份证所在地省-名称
                String domicileProvince = cstNpBscInfoVO.getDomicileProvince();
                view.addObject("domicileProvince", domicileProvince);
                view.addObject("domicileProvinceNm", null);
                if (StringUtils.isNotBlank(domicileProvince)) {
                    view.addObject("domicileProvinceNm", this.getCommonRegionDictNm(domicileProvince));
                }
                // 身份证所在地市-编码
                // 身份证所在地市-名称
                String domicileCity = cstNpBscInfoVO.getDomicleCity();
                view.addObject("domicileCity", domicileCity);
                view.addObject("domicileCityNm", null);
                if (StringUtils.isNotBlank(domicileCity)) {
                    view.addObject("domicileCityNm", this.getCommonRegionDictNm(domicileCity));
                }
                // 身份证详细地址
                view.addObject("idAddr", cstNpBscInfoVO.getIdAddr());
                // 签发机关
                view.addObject("issuingOrg", cstNpBscInfoVO.getIssuingOrg());

                // 家庭地址省-编码
                // 家庭地址省-名称
                String postProvince = cstNpBscInfoVO.getPostProvince();
                view.addObject("postProvince", postProvince);
                view.addObject("postProvinceNm", null);
                if (StringUtils.isNotBlank(postProvince)) {
                    view.addObject("postProvinceNm", this.getCommonRegionDictNm(postProvince));
                }
                // 家庭地址市-编码
                // 家庭地址市-名称
                String postCity = cstNpBscInfoVO.getPostCity();
                view.addObject("postCity", postCity);
                view.addObject("postCityNm", null);
                if (StringUtils.isNotBlank(postCity)) {
                    view.addObject("postCityNm", this.getCommonRegionDictNm(postCity));
                }
                // 家庭地址详细地址
                view.addObject("postAddr", cstNpBscInfoVO.getPostAddr());

                // 月收入
                view.addObject("monthInc", StringUtils.isEmpty(cstNpBscInfoVO.getYrInc()) ? null : String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(cstNpBscInfoVO.getYrInc()), 12D)));
                view.addObject("highDgCd", cstNpBscInfoVO.getHighDgCd());
                view.addObject("highDgCdNm", cstNpBscInfoVO.getHighDgCdNm());
                view.addObject("nation", cstNpBscInfoVO.getNation());
                view.addObject("certValidSDt", cstNpBscInfoVO.getCertValidSDt());
                view.addObject("certValidEDt", cstNpBscInfoVO.getCertValidEDt());

                view.addObject("indCdNm", cstBscInfoVO.getIndCdNm());
                if (CollectionUtils.isNotEmpty(indCdList) && StringUtils.isNotBlank(cstBscInfoVO.getIndCd()) && StringUtils.isBlank(cstBscInfoVO.getIndCdNm())) {
                    for (KeyValueVO keyValueVO : indCdList) {
                        if (cstBscInfoVO.getIndCd().equals(keyValueVO.getKey())) {
                            view.addObject("indCdNm", keyValueVO.getValue());
                            break;
                        }
                    }
                }

//                if (CollectionUtils.isNotEmpty(nationList) && StringUtils.isNotBlank(cstNpBscInfoVO.getNation())) {
//                    for (KeyValueVO keyValueVO : nationList) {
//                        if (cstNpBscInfoVO.getNation().equals(keyValueVO.getKey())) {
//                            view.addObject("nationNm", keyValueVO.getValue());
//                            break;
//                        }
//                    }
//                }

                if (CollectionUtils.isNotEmpty(highDgCdList) && StringUtils.isNotBlank(cstNpBscInfoVO.getHighDgCd()) && StringUtils.isBlank(cstNpBscInfoVO.getHighDgCdNm())) {
                    for (KeyValueVO keyValueVO : highDgCdList) {
                        if (cstNpBscInfoVO.getHighDgCd().equals(keyValueVO.getKey())) {
                            view.addObject("highDgCdNm", keyValueVO.getValue());
                            break;
                        }
                    }
                }

            }

        }
        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        BaseLogUtils.newLogger("亿联银行保存信息,获取账户信息Start,prjId:{}", prjId).info();
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        BaseLogUtils.newLogger("亿联银行保存信息,获取账户信息End,prjId:{},prjCstAccInfoVOS:{}", prjId, JSONObject.toJSONString(prjCstAccInfoVOS)).info();
        if (CollectionUtils.isEmpty(prjCstAccInfoVOS)) {
            PrjCstAccInfoVO prjCstAccInfoVO = new PrjCstAccInfoVO();
            prjCstAccInfoVO.setPrjId(Long.valueOf(prjId));
            prjCstAccInfoVO.setInsCode(prjBscInfoVO.getInsCode());
            prjCstAccInfoVO.setCstId(prjBscInfoVO.getCstId());
            prjCstAccInfoVO.setCstNm(prjBscInfoVO.getCstNm());
            prjCstAccInfoVO.setCertNo(prjBscInfoVO.getCertNo());
            prjCstAccInfoVO.setIsValid(BaseConstant.IS_YESNO_YES);
            prjCstAccInfoVO.setIsDel(BaseConstant.IS_YESNO_NO);
            prjCstAccInfoVO.setCrtUsrId(CurrentThreadContext.getCurrentUserId());
            prjCstAccInfoVO.setCrtTm(new Date());
            BaseLogUtils.newLogger("亿联银行保存信息,保存账户信息Start,prjId:{}", prjId).info();
            Long addId = this.prjCstAccInfoService.add(prjCstAccInfoVO);
            BaseLogUtils.newLogger("亿联银行保存信息,保存账户信息End,prjId:{},addId:{}", prjId, addId).info();
        }
        BaseLogUtils.newLogger("亿联银行信息采集查询End,prjId:{}, view:{}", prjId, JSONObject.toJSONString(view)).info();
    }

    /**
     * 转向填写资管资料页面 众邦银行（新）
     */
    private void viewOfPrjBscInfoEditPageForZBBANKX(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");

        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
        BaseLogUtils.newLogger("根据prjId获取账户信息：" + JSONObject.toJSONString(prjCstAccInfoQC)).info();
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        BaseLogUtils.newLogger("根据prjId获取账户信息" + JSON.toJSONString(prjCstAccInfoVOS)).info();
        if(CollectionUtils.isNotEmpty(prjCstAccInfoVOS)){
            view.addObject("cstAccInfoId", prjCstAccInfoVOS.get(0).getId()); // 项目客户账号信息主键
            view.addObject("bkNm", prjCstAccInfoVOS.get(0).getBkNm()); // 银行名称
            view.addObject("accNo", prjCstAccInfoVOS.get(0).getAccNo()); // 银行账号
            view.addObject("bkCd", prjCstAccInfoVOS.get(0).getBkCd()); // 银行代码
            view.addObject("mp", prjCstAccInfoVOS.get(0).getMp()); // 银行卡绑定手机号
        }

        BaseLogUtils.newLogger("根据ID查询自然人客户基本信息请求" + prjBscInfoVO.getCstId()).info();
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        BaseLogUtils.newLogger("查询自然人客户基本信息返回==cstNpBscInfoDTO" + JSON.toJSONString(cstNpBscInfoVO)).info();
        String certValidEDt = "";
        String certValidSDt = "";
        if(null != cstNpBscInfoVO){
            Long yrInc = cstNpBscInfoVO.getYrInc();
            if (null != yrInc) {
                //年收入 / 12 / 100 转元 得到 月收入（元）
                String monthInc = String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(yrInc), 12D));
                BigDecimal decimal = new BigDecimal(monthInc);
                monthInc = decimal.toPlainString();
                view.addObject("monthInc", monthInc); //月收入
            }
            view.addObject("postProvince", cstNpBscInfoVO.getPostProvince());
            view.addObject("postCity", cstNpBscInfoVO.getPostCity());
            view.addObject("postCounty", cstNpBscInfoVO.getPostCounty());
        }

        List<KeyValueVO> list = getBankList(PrjBscInfoConstant.PRJ_INS_CODE_ZBBANKX);
        view.addObject("bankList",list);//银行列表
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code
        view.addObject("certNo", prjBscInfoVO.getCertNo());//身份证号
        BaseLogUtils.newLogger("转向填写资管资料页面 众邦银行（新）,进入页面=" + JSONObject.toJSONString(view)).info();
        resultVO.setData(view);
    }

    /**
     * 转向填写资管资料页面 上实融资租赁有限公司
     * @param request
     * @param view
     * @param prjBscInfoVO
     */
    private void viewOfPrjBscInfoEditPageForSSFL(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");
        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForSSFL.根据prjId获取账户信息Start.prjId:{},qc:{}", prjBscInfoVO.getId(), JSON.toJSONString(prjCstAccInfoQC)).info();
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForSSFL.根据prjId获取账户信息End.prjId:{},list:{}", prjBscInfoVO.getId(), JSON.toJSONString(prjCstAccInfoVOS)).info();
        if (CollectionUtils.isNotEmpty(prjCstAccInfoVOS)) {
            view.addObject("cstAccInfoId", prjCstAccInfoVOS.get(0).getId()); // 项目客户账号信息主键
            view.addObject("bkNm", prjCstAccInfoVOS.get(0).getBkNm()); // 银行名称
            view.addObject("accNo", prjCstAccInfoVOS.get(0).getAccNo()); // 银行账号
            view.addObject("bkCd", prjCstAccInfoVOS.get(0).getBkCd()); // 银行代码
            view.addObject("mp", prjCstAccInfoVOS.get(0).getMp()); // 银行卡绑定手机号
            // 签约到期时间
            view.addObject("creditExpireDt", DateUtils.formatDateToString(prjCstAccInfoVOS.get(0).getCreditExpireDt(), DateUtils.YYYY_MM_DD));
        }

        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForSSFL.根据ID查询自然人客户基本信息请求Start.cstId:{}", prjBscInfoVO.getCstId()).info();
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForSSFL.根据ID查询自然人客户基本信息请求End.cstId:{},vo:{}", prjBscInfoVO.getCstId(), JSON.toJSONString(cstNpBscInfoVO)).info();
        if (null != cstNpBscInfoVO) {
            Long yrInc = cstNpBscInfoVO.getYrInc();
            if (null != yrInc) {
                //年收入 / 12 / 100 转元 得到 月收入（元）
                String monthInc = String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(yrInc), 12D));
                BigDecimal decimal = new BigDecimal(monthInc);
                monthInc = decimal.toPlainString();
                //月收入
                view.addObject("monthInc", monthInc);
            }
            //民族
            view.addObject("nation", cstNpBscInfoVO.getNation());
            // 证件有效起始日期
            view.addObject("certValidSDt", cstNpBscInfoVO.getCertValidSDt());
            // 证件有效截止日期
            view.addObject("certValidEDt", cstNpBscInfoVO.getCertValidEDt());
            //签发机关
            view.addObject("issuingOrg", cstNpBscInfoVO.getIssuingOrg());
            // 居住地
            view.addObject("postProvince", cstNpBscInfoVO.getPostProvince());
            view.addObject("postCity", cstNpBscInfoVO.getPostCity());
            view.addObject("postAddr", cstNpBscInfoVO.getPostAddr());
            //户籍地
            view.addObject("domicileProvince", cstNpBscInfoVO.getDomicileProvince());
            view.addObject("domicileCity", cstNpBscInfoVO.getDomicleCity());
            // 户籍地详细地址
            view.addObject("idAddr", cstNpBscInfoVO.getIdAddr());
        }

        List<KeyValueVO> list = getBankList(PrjBscInfoConstant.PRJ_INS_CODE_SSFL);
        view.addObject("bankList", list);//银行列表
        // 民族
        List<KeyValueVO> nationList = this.sysDictionaryApiService.getKvList(DictionaryConstant.CODE_GRP_CST_NATION_CD, CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd());
        BaseLogUtils.newLogger("viewOfPrjBscInfoEditPageForSSFL.上实银行信息采集查询,居住状况字典列表,nationList:{}", JSONObject.toJSONString(nationList)).info();
        view.addObject("nationList", nationList);
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code
        view.addObject("certNo", prjBscInfoVO.getCertNo());//身份证号
        BaseLogUtils.newLogger("转向填写资管资料页面 上实租赁,进入页面=" + JSONObject.toJSONString(view)).info();
        resultVO.setData(view);
    }

    /**
     * 转向填写资管资料页面 平安银行
     * @param request
     * @param view
     * @param prjBscInfoVO
     */
    private void viewOfPrjBscInfoEditPageForPABANK(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");
        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setPrjId(prjBscInfoVO.getId());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
        BaseLogUtils.newLogger("根据prjId获取账户信息Start.prjId:{},qc:{}", prjBscInfoVO.getId(), JSON.toJSONString(prjCstAccInfoQC)).info();
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        BaseLogUtils.newLogger("根据prjId获取账户信息End.prjId:{},list:{}", prjBscInfoVO.getId(), JSON.toJSONString(prjCstAccInfoVOS)).info();
        String bkCd = "";
        if (CollectionUtils.isNotEmpty(prjCstAccInfoVOS)) {
            PrjCstAccInfoVO prjCstAccInfoVO = prjCstAccInfoVOS.get(0);
            bkCd = prjCstAccInfoVO.getBkCd();
            view.addObject("cstAccInfoId", prjCstAccInfoVO.getId()); // 项目客户账号信息主键
            view.addObject("bkNm", prjCstAccInfoVO.getBkNm()); // 银行名称
            view.addObject("accNo", prjCstAccInfoVO.getAccNo()); // 银行账号
            view.addObject("bkCd", prjCstAccInfoVO.getBkCd()); // 银行代码
            view.addObject("mp", prjCstAccInfoVO.getMp()); // 银行卡绑定手机号
            view.addObject("insAccNo", prjCstAccInfoVO.getInsAccNo()); // 客户电子户账户
        }
        SysCdMapDQueryCondition cdMapDQC = new SysCdMapDQueryCondition();
        cdMapDQC.setSysCd(WebBaseConstant.SYS_SYS_CD);
        cdMapDQC.setOrgCd(CurrentThreadContext.getCurrentOrgCd());
        cdMapDQC.setmTypCd("M1041");
        cdMapDQC.setTCode(PrjBscInfoConstant.PRJ_INS_CODE_PABANK);
        List<SysCdMapDDTO> sysCdMapDList =  this.sysCdMapApiService.searchSysCdMapDWithTargetList(cdMapDQC);
        BaseLogUtils.newLogger("平安银行列表sysCdMapDList：{}",JSONObject.toJSONString(view)).info();

        if (!"true".equals(request.getParameter("detailFlag"))){
            sysCdMapDList = sysCdMapDList.stream().filter(sysCdMapDDTO -> "1".equals(sysCdMapDDTO.getCodeAttr1())).sorted(Comparator.comparing(SysCdMapDDTO::getCodeAttr2)).collect(Collectors.toList());
            BaseLogUtils.newLogger("平安银行列表修改页collect：{}",JSONObject.toJSONString(sysCdMapDList)).info();
        }
        //查询支持的银行列表
        List<KeyValueVO> list = new ArrayList<>();
        //查询开户行列表 并将各开户行限额存入map集合中
        JSONObject singleQuotaMap = new JSONObject();
        if (CollectionUtils.isNotEmpty(sysCdMapDList)) {
            for(SysCdMapDDTO sysCdMapDDTO : sysCdMapDList) {
                KeyValueVO kv = new KeyValueVO();
                kv.setKey(sysCdMapDDTO.getSCode());
                kv.setValue(sysCdMapDDTO.getSCodeNm());
                list.add(kv);
                singleQuotaMap.put(sysCdMapDDTO.getSCode(), sysCdMapDDTO.getCodeAttr2()); // 单笔限额
            }
        }
        view.addObject("singleQuotaMap",singleQuotaMap);
        //获取开户行限额
        if(StringUtils.isNotBlank(bkCd) && singleQuotaMap.containsKey(bkCd)){
            String singleQuota = singleQuotaMap.getString(bkCd);
            view.addObject("singleQuota", singleQuota);
        }
        view.addObject("bankList", list);
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code
        view.addObject("certNo", prjBscInfoVO.getCertNo());//身份证号
        BaseLogUtils.newLogger("转向填写资管资料页面 平安银行,进入页面=" + JSONObject.toJSONString(view)).info();
        resultVO.setData(view);
    }

    /**
     * 转向填写资管资料页面 浦发二期（spdbankde）
     */
    private void viewOfPrjBscInfoEditPageForSPDBANKDE(HttpServletRequest request, ModelAndView view, PrjBscInfoVO prjBscInfoVO) {
        DataResultVO resultVO = new DataResultVO(BaseConstant.IS_YESNO_YES, "查询成功");

        PrjCstAccInfoQueryCondition prjCstAccInfoQC = new PrjCstAccInfoQueryCondition();
        prjCstAccInfoQC.setCstId(prjBscInfoVO.getCstId());
        prjCstAccInfoQC.setIsDel(BaseConstant.IS_YESNO_NO);
        prjCstAccInfoQC.setInsCode(prjBscInfoVO.getInsCode());
        List<PrjCstAccInfoVO> prjCstAccInfoVOS = this.prjCstAccInfoService.searchList(prjCstAccInfoQC);
        PrjCstAccInfoVO vo = null;
        if (CollectionUtils.isNotEmpty(prjCstAccInfoVOS)) {
            vo = prjCstAccInfoVOS.stream().filter(prjCstAccInfoVO -> prjBscInfoVO.getId().equals(prjCstAccInfoVO.getPrjId())).findFirst().orElse(null);
            if (null == vo) {
                vo = prjCstAccInfoVOS.stream().filter(prjCstAccInfoVO -> InsAccResEnum.SUCCESS.getCode().equals(prjCstAccInfoVO.getAccResCd())).findFirst().orElse(null);
                if (null != vo) {
                    vo.setId(null);
                    vo.setPrjId(prjBscInfoVO.getId());
                    vo.setCrtTm(new Date());
                    vo.setCrtUsrId(CurrentThreadContext.getCurrentUserId());
                    vo.setMdfTm(new Date());
                    vo.setMdfUsrId(CurrentThreadContext.getCurrentUserId());
                    vo.setRepayMp(null);
                    vo.setRepayBkCd(null);
                    vo.setRepayBkNm(null);
                    vo.setRepayBkNo(null);
                    vo.setRepayAccNo(null);
                    vo.setRepayAccSignResCd(null);
                    vo.setRepayAccSignResMsg(null);
                    Long add = this.prjCstAccInfoService.add(vo);
                    vo.setId(add);
                }
            }
        }
        if (null == vo) {
            vo = new PrjCstAccInfoVO();
        }
        view.addObject("cstAccInfoId", vo.getId()); // 项目客户账号信息主键
        view.addObject("bkNm", vo.getBkNm()); // 银行名称
        view.addObject("accNo", vo.getAccNo()); // 银行账号
        view.addObject("bkCd", vo.getBkCd()); // 银行代码
        view.addObject("mp", vo.getMp()); // 银行卡绑定手机号
        view.addObject("insAccNo", vo.getInsAccNo()); // 客户电子户账户
        view.addObject("repayAccNo", vo.getRepayAccNo());
        view.addObject("repayBkCd", vo.getRepayBkCd());
        view.addObject("repayBkNm", vo.getRepayBkNm());
        view.addObject("repayBkNo", vo.getRepayBkNo());
        view.addObject("repayMp", vo.getRepayMp());
        view.addObject("repayAccSignResCd", vo.getRepayAccSignResCd());
        view.addObject("repayAccSignResMsg", vo.getRepayAccSignResMsg());
        view.addObject("accResCd", vo.getAccResCd());
        view.addObject("accResMsg", vo.getAccResMsg());

        BaseLogUtils.newLogger("根据ID查询自然人客户基本信息请求" + prjBscInfoVO.getCstId()).info();
        CstNpBscInfoVO cstNpBscInfoVO = this.cstNpBscInfoService.selectById(prjBscInfoVO.getCstId());
        BaseLogUtils.newLogger("查询自然人客户基本信息返回==cstNpBscInfoDTO" + JSON.toJSONString(cstNpBscInfoVO)).info();
        if(null != cstNpBscInfoVO){
            Long yrInc = cstNpBscInfoVO.getYrInc();
            if (null != yrInc) {
                //年收入 / 12 / 100 转元 得到 月收入（元）
                String monthInc = String.valueOf(DecimalUtils.div(DecimalUtils.convertFenToYuan(yrInc), 12D));
                BigDecimal decimal = new BigDecimal(monthInc);
                monthInc = decimal.toPlainString();
                view.addObject("monthInc", monthInc); //月收入
            }
            view.addObject("highDgCd", cstNpBscInfoVO.getHighDgCd());
        }
        List<KeyValueVO> highDgCdList = this.sysDictionaryApiService.getKvList(DictionaryConstant.CODE_GRP_CST_HIGH_DG_CD, CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd());
        view.addObject("highDgCdList", highDgCdList);

        List<KeyValueVO> list = getBankList(PrjBscInfoConstant.PRJ_INS_CODE_SPDBANKDE);
        view.addObject("bankList",list);//银行列表
        view.addObject("cstId", prjBscInfoVO.getCstId()); // 客户ID
        view.addObject("prjId", prjBscInfoVO.getId()); // 项目ID
        view.addObject("cstNm", prjBscInfoVO.getCstNm()); // 客户名称
        view.addObject("fundRasInsNm", prjBscInfoVO.getFundRasInsNm()); // 机构名称
        view.addObject("insCode", prjBscInfoVO.getInsCode());//机构code
        view.addObject("certNo", prjBscInfoVO.getCertNo());//身份证号
        BaseLogUtils.newLogger("转向填写资管资料页面 浦发二期（spdbankde）,进入页面=" + JSONObject.toJSONString(view)).info();
        resultVO.setData(view);
    }

}
